- Re-jigged DoJump() to not be recursive so that 0-tic A_Jump* loops are no longer

able to potentially blow up the stack.

SVN r3902 (scripting)
This commit is contained in:
Randy Heit 2012-10-23 03:19:17 +00:00
commit d0c91083bc
3 changed files with 19 additions and 1 deletions

View file

@ -482,7 +482,16 @@ bool AActor::SetState (FState *newstate, bool nofunction)
{
// Check whether the called action function resulted in destroying the actor
if (ObjectFlags & OF_EuthanizeMe)
{
return false;
}
if (ObjectFlags & OF_StateChanged)
{ // The action was an A_Jump-style function that wants to change the next state.
ObjectFlags &= ~OF_StateChanged;
newstate = state;
tics = 0; // make sure we loop and set the new state properly
continue;
}
}
newstate = newstate->GetNextState();
} while (tics == 0);