+
+ // when animation mode is "once", stop after all animations were played once
+ if (c->anim_mode & ANIM_ONCE &&
+ anim->part_counter == anim->num_parts)
+ anim->state = ANIM_STATE_INACTIVE;
+
+ state = anim->state;
+ active_part_nr = anim->active_part_nr;
+
+ // while the animation parts are pausing (waiting or inactive), play the base
+ // (main) animation; this corresponds to the "boring player animation" logic
+ // (!!! KLUDGE WARNING: I THINK THIS IS A MESS THAT SHOULD BE CLEANED UP !!!)
+ if (anim->has_base)
+ {
+ if (anim->state == ANIM_STATE_WAITING ||
+ anim->state == ANIM_STATE_INACTIVE)
+ {
+ anim->active_part_nr = anim->num_parts; // part nr of base animation
+ part = &anim->part[anim->active_part_nr];
+
+ if (anim->state != anim->last_state)
+ part->state = ANIM_STATE_RESTART;
+
+ anim->state = ANIM_STATE_RUNNING;
+ part->state = HandleGlobalAnim_Part(part, part->state);
+ }
+ }
+
+ anim->last_state = state;
+ anim->last_active_part_nr = active_part_nr;