From: Holger Schemel Date: Thu, 26 Oct 2023 08:18:20 +0000 (+0200) Subject: fixed bug with global animation at wrong playfield position for one frame X-Git-Tag: 4.3.7.0~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fce6382552e249112dd8c27ee78f42b00d86e1f4;p=rocksndiamonds.git fixed bug with global animation at wrong playfield position for one frame This fixes a bug that should have been fixed with commit 03202ac7. While the above commit fixes the problem for some cases, it still does not work correctly if a global animation with ".position: ce" has two "ce_change" events defined with ".init_event" and ".anim_event". While the first one starts the animation (and should therefore place the animation at the CE position), the second one stops the animation (and starts the next part of the animation, if existing), so it should not change the position to the second CE (which would only be used for one single game frame and then changed to the animation position defined by the next part of the animation). --- diff --git a/src/anim.c b/src/anim.c index c457936b..ee2e1ede 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1468,7 +1468,9 @@ static void InitGlobalAnim_Triggered_ByCustomElement(int nr, int page, part2->tile_yoffset = c->y; // set resulting animation position relative to CE tile position - SetGlobalAnimPartTileXY(part2); + // (but only for ".init_event", not ".anim_event" type events) + if (part2->init_event_state) + SetGlobalAnimPartTileXY(part2); // restart animation (by using current sync frame) part2->initial_anim_sync_frame = anim_sync_frame;