diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 2786015c9..3b7b2d87f 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -714,6 +714,25 @@ protected: FBehavior *activeBehavior; int InModuleScriptNumber; + TArray ACS_StringBuilderStack; + + inline void STRINGBUILDER_START(FString &Builder) + { + if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) + { + ACS_StringBuilderStack.Push(Builder); + Builder = ""; + } + } + + inline void STRINGBUILDER_FINISH(FString &Builder) + { + if (!ACS_StringBuilderStack.Pop(Builder)) + { + Builder = ""; + } + } + void Link(); void Unlink(); void PutLast(); @@ -788,10 +807,6 @@ struct FBehavior::ArrayInfo }; TArray FBehavior::StaticModules; -TArray ACS_StringBuilderStack; - -#define STRINGBUILDER_START(Builder) if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) { ACS_StringBuilderStack.Push(Builder); Builder = ""; } -#define STRINGBUILDER_FINISH(Builder) if (!ACS_StringBuilderStack.Pop(Builder)) { Builder = ""; } //============================================================================ // @@ -3468,12 +3483,6 @@ void DACSThinker::Tick () // GlobalACSStrings.Clear(); - if (ACS_StringBuilderStack.Size()) - { - int size = ACS_StringBuilderStack.Size(); - ACS_StringBuilderStack.Clear(); - I_Error("Error: %d garbage entries on ACS string builder stack.", size); - } ACSTime.Unclock(); }