From 5d688872e00337790fc6fd5ae52c16d9cc99a9da Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 8 Oct 2023 12:54:52 +0300 Subject: [PATCH 69/69] Remove virtual unit refcount handling from movement animation We use separate virtual units for each animation now, and the refcount was used completely wrong. See osdn #48821 Signed-off-by: Marko Lindqvist --- client/mapview_common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/mapview_common.c b/client/mapview_common.c index b227feae7e..0da948f0fa 100644 --- a/client/mapview_common.c +++ b/client/mapview_common.c @@ -271,9 +271,7 @@ static bool movement_animation(struct animation *anim, double time_gone) if (time_gone >= timing_sec) { /* Animation over */ - if (--anim->movement.mover->refcount <= 0) { - unit_virtual_destroy(anim->movement.mover); - } + unit_virtual_destroy(anim->movement.mover); return TRUE; } @@ -2705,7 +2703,6 @@ void move_unit_map_canvas(struct unit *punit, anim->type = ANIM_MOVEMENT; anim->id = punit->id; - punit->refcount++; anim->movement.mover = unit_virtual_create(unit_owner(punit), NULL, unit_type_get(punit), punit->veteran); -- 2.40.1