From: Holger Schemel Date: Wed, 16 Aug 2023 13:55:22 +0000 (+0200) Subject: fixed setting global animation sync frame when started with ".init_event" X-Git-Tag: 4.3.7.0~31 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=750acafbde75f2f9006a1aee9da683b20e20998e;p=rocksndiamonds.git fixed setting global animation sync frame when started with ".init_event" The previous code only handled adjusting the initial animation sync frame when starting the animation using an "init delay" configuration (starting the animation after a delay), but did not handle starting the animation using an "init event" configuration (like triggering by a click event or by a custom element change), in which case the sync frame should also be reset. --- diff --git a/src/anim.c b/src/anim.c index d780658c..d570be06 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1566,7 +1566,12 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, part->init_event_state) { if (part->initial_anim_sync_frame > 0) - part->initial_anim_sync_frame -= part->init_delay_counter - 1; + { + if (part->init_delay_counter > 0) + part->initial_anim_sync_frame -= part->init_delay_counter - 1; + else + part->initial_anim_sync_frame = anim_sync_frame; + } part->init_delay_counter = 1; part->init_event_state = FALSE;