mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Simplify NoDelay implementation
- All NoDelay needs to do is call the current state's function. Calling SetState() is excessive.
This commit is contained in:
parent
5d65b10aec
commit
5aba252b87
2 changed files with 3 additions and 11 deletions
|
@ -3673,17 +3673,9 @@ void AActor::Tick ()
|
||||||
if (state->GetNoDelay())
|
if (state->GetNoDelay())
|
||||||
{
|
{
|
||||||
// For immediately spawned objects with the NoDelay flag set for their
|
// For immediately spawned objects with the NoDelay flag set for their
|
||||||
// Spawn state, explicitly set the current state so that it calls its
|
// Spawn state, explicitly call the current state's function.
|
||||||
// action and chains 0-tic states.
|
if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe))
|
||||||
int starttics = tics;
|
|
||||||
if (!SetState(state))
|
|
||||||
return; // freed itself
|
return; // freed itself
|
||||||
// If the initial state had a duration of 0 tics, let the next state run
|
|
||||||
// normally. Otherwise, increment tics by 1 so that we don't double up ticks.
|
|
||||||
else if (starttics > 0 && tics >= 0)
|
|
||||||
{
|
|
||||||
tics++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cycle through states, calling action functions at transitions
|
// cycle through states, calling action functions at transitions
|
||||||
|
|
|
@ -2375,7 +2375,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log)
|
||||||
|
|
||||||
if (text[0] == '$') text = GStrings(text+1);
|
if (text[0] == '$') text = GStrings(text+1);
|
||||||
FString formatted = strbin1(text);
|
FString formatted = strbin1(text);
|
||||||
Printf("%s\n", formatted.GetChars());
|
Printf("%4d: %s\n", gametic, formatted.GetChars());
|
||||||
ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains!
|
ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue