From 910451a351f71d8637683253490218ea4bfee799 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 6 Jan 2015 19:50:01 -0600 Subject: [PATCH] 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. --- src/thingdef/thingdef_states.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 26c4deddb..2d676b642 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -66,7 +66,7 @@ TDeletingArray 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; }