Return a FxVMFunctionCall from DoActionSpecials()

- DoActionSpecials no longer sets the function call in FStateTempCall.
  Instead, it returns the function so the caller can do it.
This commit is contained in:
Randy Heit 2015-01-06 19:50:01 -06:00
parent 320fb9aec5
commit 910451a351
1 changed files with 5 additions and 6 deletions

View File

@ -66,7 +66,7 @@ TDeletingArray<FStateTempCall *> StateTempCalls;
// handles action specials as code pointers
//
//==========================================================================
bool DoActionSpecials(FScanner &sc, FState & state, Baggage &bag, FStateTempCall *tcall)
FxVMFunctionCall *DoActionSpecials(FScanner &sc, FState & state, Baggage &bag)
{
int i;
int min_args, max_args;
@ -100,11 +100,9 @@ bool DoActionSpecials(FScanner &sc, FState & state, Baggage &bag, FStateTempCall
{
sc.ScriptError ("Too many arguments to %s", specname.GetChars());
}
tcall->Call = new FxVMFunctionCall(FindGlobalActionFunction("A_CallSpecial"), args, sc);
return true;
return new FxVMFunctionCall(FindGlobalActionFunction("A_CallSpecial"), args, sc);
}
return false;
return NULL;
}
//==========================================================================
@ -319,7 +317,8 @@ do_stop:
// Make the action name lowercase
strlwr (sc.String);
if (DoActionSpecials(sc, state, bag, tcall))
tcall->Call = DoActionSpecials(sc, state, bag);
if (tcall->Call != NULL)
{
goto endofstate;
}