From 1214f8ba0088c15368a59d1cab4d970aa2fef8ac Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 19 Oct 2021 21:09:49 +0200 Subject: [PATCH] - properly macro-fy parsed strings from Blood's INI. --- source/core/mapinfo.h | 9 ++------- source/games/blood/src/levels.cpp | 5 +++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/source/core/mapinfo.h b/source/core/mapinfo.h index af7606f92..d29a72c18 100644 --- a/source/core/mapinfo.h +++ b/source/core/mapinfo.h @@ -65,12 +65,6 @@ extern int gDefaultVolume, gDefaultSkill; // Localization capable replacement of the game specific solutions. -inline void MakeStringLocalizable(FString "e) -{ - // Only prepend a quote if the string is localizable. - if (quote.Len() > 0 && quote[0] != '$' && GStrings[quote]) quote.Insert(0, "$"); -} - enum { MI_FORCEEOG = 1, @@ -172,7 +166,8 @@ struct MapRecord void SetName(const char *n) { name = n; - MakeStringLocalizable(name); + name.StripRight(); + name = FStringTable::MakeMacro(name); } void SetFileName(const char* n) { diff --git a/source/games/blood/src/levels.cpp b/source/games/blood/src/levels.cpp index 2a5e2244e..bc8bae6ef 100644 --- a/source/games/blood/src/levels.cpp +++ b/source/games/blood/src/levels.cpp @@ -167,8 +167,9 @@ void levelLoadDefaults(void) auto cluster = MustFindCluster(i); auto volume = MustFindVolume(i); CutsceneDef &csB = cluster->outro; - auto ep_str = BloodINI->GetKeyString(buffer, "Title", buffer); - cluster->name = volume->name = ep_str; + FString ep_str = BloodINI->GetKeyString(buffer, "Title", buffer); + ep_str.StripRight(); + cluster->name = volume->name = FStringTable::MakeMacro(ep_str); if (i > 1) volume->flags |= VF_SHAREWARELOCK; if (BloodINI->GetKeyInt(buffer, "BloodBathOnly", 0)) volume->flags |= VF_HIDEFROMSP;