From 45c1787203a78d557b86dcc5fd1a82476a82dc75 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 2 Jun 2013 23:17:46 +0000 Subject: [PATCH] - Fixed: Don't transform map variable string initializers into global string table entries if they don't really exist in the source string table. SVN r4321 (trunk) --- src/p_acs.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 99ddf7780..8f00bad73 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -1881,7 +1881,11 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len) for (DWORD i = 0; i < chunk[1]/4; ++i) { // MapVarStore[chunk[i+2]] |= LibraryID; - MapVarStore[chunk[i+2]] = GlobalACSStrings.AddString(LookupString(MapVarStore[chunk[i+2]])); + const char *str = LookupString(MapVarStore[chunk[i+2]]); + if (str != NULL) + { + MapVarStore[chunk[i+2]] = GlobalACSStrings.AddString(str); + } } } @@ -1897,7 +1901,11 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len) for (int j = ArrayStore[arraynum].ArraySize; j > 0; --j, ++elems) { // *elems |= LibraryID; - *elems = GlobalACSStrings.AddString(LookupString(*elems)); + const char *str = LookupString(*elems); + if (str != NULL) + { + *elems = GlobalACSStrings.AddString(str); + } } } } @@ -1927,7 +1935,11 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len) } else if (*chunkData == 1) { - *elems = GlobalACSStrings.AddString(LookupString(*elems)); + const char *str = LookupString(*elems); + if (str != NULL) + { + *elems = GlobalACSStrings.AddString(str); + } } } i += 4+ArrayStore[arraynum].ArraySize;