From 7106c06811faed97870477abe593619f6ba5e6b0 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 26 Feb 2012 02:25:33 +0000 Subject: [PATCH] - Allow for ACS_NamedExecute and friends to be used with SetThingSpecial. SVN r3389 (trunk) --- src/p_acs.cpp | 18 ++++++++++++++---- src/p_mobj.cpp | 12 ++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 72f42694e..ef32fe407 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5776,6 +5776,16 @@ int DLevelScript::RunScript () case PCD_SETTHINGSPECIAL: { + int specnum = STACK(6); + int arg0 = STACK(5); + + // Convert named ACS "specials" into real specials. + if (specnum >= -ACSF_ACS_NamedExecuteAlways && specnum <= -ACSF_ACS_NamedExecute) + { + specnum = NamedACSToNormalACS[-specnum - ACSF_ACS_NamedExecute]; + arg0 = -FName(FBehavior::StaticLookupString(arg0)); + } + if (STACK(7) != 0) { FActorIterator iterator (STACK(7)); @@ -5783,8 +5793,8 @@ int DLevelScript::RunScript () while ( (actor = iterator.Next ()) ) { - actor->special = STACK(6); - actor->args[0] = STACK(5); + actor->special = specnum; + actor->args[0] = arg0; actor->args[1] = STACK(4); actor->args[2] = STACK(3); actor->args[3] = STACK(2); @@ -5793,8 +5803,8 @@ int DLevelScript::RunScript () } else if (activator != NULL) { - activator->special = STACK(6); - activator->args[0] = STACK(5); + activator->special = specnum; + activator->args[0] = arg0; activator->args[1] = STACK(4); activator->args[2] = STACK(3); activator->args[3] = STACK(2); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 7f8e9b3f9..3ff207d49 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -260,8 +260,16 @@ void AActor::Serialize (FArchive &arc) << tracer << floorclip << tid - << special - << args[0] << args[1] << args[2] << args[3] << args[4] + << special; + if (P_IsACSSpecial(special)) + { + P_SerializeACSScriptNumber(arc, args[0], false); + } + else + { + arc << args[0]; + } + arc << args[1] << args[2] << args[3] << args[4] << goal << waterlevel << MinMissileChance