- changed action function interface so that callers can be identified directly, instead of guessing it from looking at the parameters.

With arbitrary PSP layers the old method was no longer safe because the layer ID was not available in the action function.
This commit is contained in:
Christoph Oelckers 2016-06-16 16:11:00 +02:00
parent 7ccdbf9b62
commit cfaa3e3fa9
9 changed files with 54 additions and 32 deletions

View file

@ -556,7 +556,8 @@ bool AActor::SetState (FState *newstate, bool nofunction)
if (!nofunction)
{
FState *returned_state;
if (newstate->CallAction(this, this, &returned_state))
FStateParamInfo stp = { newstate, STATE_Actor, PSP_WEAPON };
if (newstate->CallAction(this, this, &stp, &returned_state))
{
// Check whether the called action function resulted in destroying the actor
if (ObjectFlags & OF_EuthanizeMe)
@ -3866,7 +3867,8 @@ bool AActor::CheckNoDelay()
// For immediately spawned objects with the NoDelay flag set for their
// Spawn state, explicitly call the current state's function.
FState *newstate;
if (state->CallAction(this, this, &newstate))
FStateParamInfo stp = { state, STATE_Actor, PSP_WEAPON };
if (state->CallAction(this, this, &stp, &newstate))
{
if (ObjectFlags & OF_EuthanizeMe)
{