From 963a6fb80872e1b500018664769721a1581055f4 Mon Sep 17 00:00:00 2001 From: avolkov Date: Wed, 18 Nov 2009 00:07:33 +0000 Subject: [PATCH] Bugfix: make RANDOM_ANIM end on a neutral frame git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3315 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/commanim.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sc2/src/uqm/commanim.c b/sc2/src/uqm/commanim.c index d7a4f3cb4..d80f35be0 100644 --- a/sc2/src/uqm/commanim.c +++ b/sc2/src/uqm/commanim.c @@ -183,6 +183,10 @@ AdvanceAmbientSequence (SEQUENCE *pSeq) { // animation ended active = FALSE; pSeq->Alarm = randomRestartRate (pSeq) + 1; + + // RANDOM_ANIM must end on a neutral frame + if (ADPtr->AnimFlags & RANDOM_ANIM) + pSeq->NextIndex = 0; } // Will draw the next frame or change to next colormap @@ -452,7 +456,8 @@ ambient_anim_task (void *data) } else if (ActiveMask & ADPtr->BlockMask) { // animation is blocked - assert (!(ActiveMask & ActiveBit)); + assert (!(ActiveMask & ActiveBit) && + "Check animations' mutual blocking masks"); assert (animAtNeutralIndex (pSeq)); // reschedule pSeq->Alarm = randomRestartRate (pSeq) + 1;