Skip to content

Commit

Permalink
- clear the Dehacked string table after passing it to GStrings.
Browse files Browse the repository at this point in the history
For some reason std::move does not work here so make sure it won't stick around.
  • Loading branch information
coelckers committed Sep 15, 2023
1 parent d001c34 commit 7f7edc4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/engine/stringtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void FStringTable::LoadStrings (const char *language)
{
int lastlump, lump;

allStrings.Clear();
lastlump = 0;
while ((lump = fileSystem.FindLump("LMACROS", &lastlump)) != -1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/common/engine/stringtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/gamedata/d_dehacked.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7f7edc4

Please sign in to comment.