From 77236132932d08a508855c3b44bd5b428f19d851 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 22 Jul 2013 02:09:46 -0400 Subject: [PATCH] - Fixed: ACS function pointer instructions were not updated when library tag size changed. - Fixed: undefined sequence compiler warning. --- src/p_acs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index f57846b3c..74a670346 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5556,7 +5556,8 @@ int DLevelScript::RunScript () case PCD_PUSHFUNCTION: { int funcnum = NEXTBYTE; - PushToStack(funcnum | activeBehavior->GetLibraryID()); + // Not technically a string, but since we use the same tagging mechanism + PushToStack(TAGSTR(funcnum)); break; } case PCD_CALL: @@ -5572,7 +5573,7 @@ int DLevelScript::RunScript () if(pcd == PCD_CALLSTACK) { funcnum = STACK(1); - module = FBehavior::StaticGetModule(funcnum>>16); + module = FBehavior::StaticGetModule(funcnum>>LIBRARYID_SHIFT); --sp; funcnum &= 0xFFFF; // Clear out tag @@ -8449,7 +8450,8 @@ scriptwait: case PCD_SAVESTRING: // Saves the string { - PushToStack(GlobalACSStrings.AddString(work, Stack, sp)); + const int str = GlobalACSStrings.AddString(work, Stack, sp); + PushToStack(str); STRINGBUILDER_FINISH(work); } break;