- Added Blzut3's noextratic fix.

SVN r4231 (trunk)
This commit is contained in:
Randy Heit 2013-04-28 03:55:31 +00:00
parent d2ef6d81da
commit 4bc60ec900

View file

@ -3498,22 +3498,29 @@ void AActor::Tick ()
// cycle through states, calling action functions at transitions // cycle through states, calling action functions at transitions
if (tics != -1) if (tics != -1)
{ {
tics--;
// you can cycle through multiple states in a tic // you can cycle through multiple states in a tic
// [RH] Use <= 0 instead of == 0 so that spawnstates // [BL] If we reach here with a 0 duration state, we
// of 0 tics work as expected. // have created an extra tic, so account for it.
if (tics <= 0) int newtics;
do
{ {
assert (state != NULL); newtics = --tics;
if (state == NULL)
// [RH] Use tics <= 0 instead of == 0 so that spawnstates
// of 0 tics work as expected.
if (tics <= 0)
{ {
Destroy(); assert (state != NULL);
return; if (state == NULL)
{
Destroy();
return;
}
if (!SetState (state->GetNextState()))
return; // freed itself
} }
if (!SetState (state->GetNextState()))
return; // freed itself
} }
while (newtics < 0);
} }
else else
{ {