X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fanim.c;h=ff44369c1576c827007e44e8460f02affb2538be;hp=6fe1cb6dc3c0ba638f5a8be3f237cbb7a17d36c1;hb=0e2c16077f04479625b1612b19047332026433c7;hpb=97aa8b2f63cbd4c210d20264f57bae3e342b14d4 diff --git a/src/anim.c b/src/anim.c index 6fe1cb6d..ff44369c 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1197,6 +1197,8 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, part->anim_delay_counter = (c->anim_delay_fixed + GetSimpleRandom(c->anim_delay_random)); + part->post_delay_counter = 0; + part->init_event_state = (c->init_event != ANIM_EVENT_UNDEFINED); part->anim_event_state = (c->anim_event != ANIM_EVENT_UNDEFINED); @@ -1633,12 +1635,14 @@ static void DoAnimationExt(void) static boolean DoGlobalAnim_EventAction(struct GlobalAnimPartControlInfo *part) { - int anim_event_action = part->control_info.anim_event_action; + int event_action = (part->init_event_state ? + part->control_info.init_event_action : + part->control_info.anim_event_action); - if (anim_event_action == -1) + if (event_action == ANIM_EVENT_ACTION_NONE) return FALSE; - PushUserEvent(USEREVENT_ANIM_EVENT_ACTION, anim_event_action, 0); + PushUserEvent(USEREVENT_ANIM_EVENT_ACTION, event_action, 0); // check if further actions are allowed to be executed if (part->control_info.style & STYLE_MULTIPLE_ACTIONS)