From 7f7edc4f72417bed52c2aa7bbd8c2f73f7650ec3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Sep 2023 21:46:53 +0200 Subject: [PATCH] - clear the Dehacked string table after passing it to GStrings. For some reason std::move does not work here so make sure it won't stick around. --- src/common/engine/stringtable.cpp | 1 + src/common/engine/stringtable.h | 2 +- src/gamedata/d_dehacked.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/engine/stringtable.cpp b/src/common/engine/stringtable.cpp index 68cec6db888..ef323694223 100644 --- a/src/common/engine/stringtable.cpp +++ b/src/common/engine/stringtable.cpp @@ -51,6 +51,7 @@ void FStringTable::LoadStrings (const char *language) { int lastlump, lump; + allStrings.Clear(); lastlump = 0; while ((lump = fileSystem.FindLump("LMACROS", &lastlump)) != -1) { diff --git a/src/common/engine/stringtable.h b/src/common/engine/stringtable.h index df1508ae86b..6850f8832ee 100644 --- a/src/common/engine/stringtable.h +++ b/src/common/engine/stringtable.h @@ -87,7 +87,7 @@ class FStringTable void LoadStrings(const char *language); void UpdateLanguage(const char* language); StringMap GetDefaultStrings() { return allStrings[default_table]; } // Dehacked needs these for comparison - void SetOverrideStrings(StringMap && map) + void SetOverrideStrings(StringMap & map) { allStrings.Insert(override_table, map); UpdateLanguage(nullptr); diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index 1a67c16abfb..9eb14381739 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -3734,7 +3734,8 @@ void FinishDehPatch () OrgSprNames.Reset(); TouchedActors.Reset(); EnglishStrings.Clear(); - GStrings.SetOverrideStrings(std::move(DehStrings)); + GStrings.SetOverrideStrings(DehStrings); + DehStrings.Clear(); // Now it gets nasty: We have to fiddle around with the weapons' ammo use info to make Doom's original // ammo consumption work as intended.