- Fixed: r4234 moved tic decrementing to the wrong spot.

SVN r4243 (trunk)
This commit is contained in:
Randy Heit 2013-05-01 02:21:43 +00:00
parent bed47c6eff
commit cadc16293e

View file

@ -3495,8 +3495,12 @@ void AActor::Tick ()
}
}
// cycle through states, calling action functions at transitions
assert (state != NULL);
if (state == NULL)
{
Destroy();
return;
}
if (ObjectFlags & OF_JustSpawned && state->GetNoDelay())
{
// For immediately spawned objects with the NoDelay flag set for their
@ -3511,21 +3515,16 @@ void AActor::Tick ()
tics++;
}
}
// cycle through states, calling action functions at transitions
if (tics != -1)
{
// [RH] Use tics <= 0 instead of == 0 so that spawnstates
// of 0 tics work as expected.
if (tics <= 0)
if (--tics <= 0)
{
if (state == NULL)
{
Destroy();
return;
}
if (!SetState(state->GetNextState()))
return; // freed itself
}
tics--;
}
else
{