From 097d644862c1d5b66c92bbe64db0ef2f30a34a4b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 27 Mar 2023 17:22:19 +0300 Subject: [PATCH 48/48] Set battle animation area correctly This affects gtk-clients See osdn #47705 Signed-off-by: Marko Lindqvist --- client/mapview_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/mapview_common.c b/client/mapview_common.c index f756c15184..cf2fb9c861 100644 --- a/client/mapview_common.c +++ b/client/mapview_common.c @@ -2533,6 +2533,8 @@ void decrease_unit_hp_smooth(struct unit *punit0, int hp0, struct animation *anim = fc_malloc(sizeof(struct animation)); struct unit *winning_unit; int winner_end_hp; + int aw = tileset_tile_width(tileset) * map_zoom; + int ah = tileset_tile_height(tileset) * map_zoom; if (losing_unit == punit1) { winning_unit = punit0; @@ -2559,6 +2561,8 @@ void decrease_unit_hp_smooth(struct unit *punit0, int hp0, anim->battle.winner_hp_end = winner_end_hp; anim->battle.steps = MAX(losing_unit->hp, anim->battle.winner_hp_start - winner_end_hp); + anim->width = aw; + anim->height = ah; animation_add(anim); anim = fc_malloc(sizeof(struct animation)); @@ -2567,8 +2571,8 @@ void decrease_unit_hp_smooth(struct unit *punit0, int hp0, anim->expl.tile = losing_unit->tile; anim->expl.sprites = get_unit_explode_animation(tileset); anim->expl.sprite_count = sprite_vector_size(anim->expl.sprites); - anim->width = tileset_tile_width(tileset) * map_zoom; - anim->height = tileset_tile_height(tileset) * map_zoom; + anim->width = aw; + anim->height = ah; animation_add(anim); } else { const struct sprite_vector *anim = get_unit_explode_animation(tileset); -- 2.39.2