From fc5853eaa4b75bea43db0089b03529b28af7ec62 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 12 Aug 2024 10:20:04 +0200 Subject: [PATCH] fix: make all game names be supported in lowercase instead of only t6 --- src/Linker/Game/IW3/ZoneCreatorIW3.cpp | 6 +++++- src/Linker/Game/IW4/ZoneCreatorIW4.cpp | 6 +++++- src/Linker/Game/IW5/ZoneCreatorIW5.cpp | 6 +++++- src/Linker/Game/T5/ZoneCreatorT5.cpp | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Linker/Game/IW3/ZoneCreatorIW3.cpp b/src/Linker/Game/IW3/ZoneCreatorIW3.cpp index c7021a24..399f01c4 100644 --- a/src/Linker/Game/IW3/ZoneCreatorIW3.cpp +++ b/src/Linker/Game/IW3/ZoneCreatorIW3.cpp @@ -4,6 +4,7 @@ #include "Game/IW3/GameAssetPoolIW3.h" #include "Game/IW3/GameIW3.h" #include "ObjLoading.h" +#include "Utils/StringUtils.h" #include @@ -59,7 +60,10 @@ void ZoneCreator::CreateZoneAssetPools(Zone* zone) const bool ZoneCreator::SupportsGame(const std::string& gameName) const { - return gameName == g_GameIW3.GetShortName(); + auto shortName = g_GameIW3.GetShortName(); + utils::MakeStringLowerCase(shortName); + + return gameName == shortName; } std::unique_ptr ZoneCreator::CreateZoneForDefinition(ZoneCreationContext& context) const diff --git a/src/Linker/Game/IW4/ZoneCreatorIW4.cpp b/src/Linker/Game/IW4/ZoneCreatorIW4.cpp index 1c3aa553..d12cc777 100644 --- a/src/Linker/Game/IW4/ZoneCreatorIW4.cpp +++ b/src/Linker/Game/IW4/ZoneCreatorIW4.cpp @@ -3,6 +3,7 @@ #include "Game/IW4/GameAssetPoolIW4.h" #include "Game/IW4/GameIW4.h" #include "ObjLoading.h" +#include "Utils/StringUtils.h" #include @@ -58,7 +59,10 @@ void ZoneCreator::CreateZoneAssetPools(Zone* zone) const bool ZoneCreator::SupportsGame(const std::string& gameName) const { - return gameName == g_GameIW4.GetShortName(); + auto shortName = g_GameIW4.GetShortName(); + utils::MakeStringLowerCase(shortName); + + return gameName == shortName; } std::unique_ptr ZoneCreator::CreateZoneForDefinition(ZoneCreationContext& context) const diff --git a/src/Linker/Game/IW5/ZoneCreatorIW5.cpp b/src/Linker/Game/IW5/ZoneCreatorIW5.cpp index 9d3bd3df..7c3d1779 100644 --- a/src/Linker/Game/IW5/ZoneCreatorIW5.cpp +++ b/src/Linker/Game/IW5/ZoneCreatorIW5.cpp @@ -3,6 +3,7 @@ #include "Game/IW5/GameAssetPoolIW5.h" #include "Game/IW5/GameIW5.h" #include "ObjLoading.h" +#include "Utils/StringUtils.h" #include @@ -58,7 +59,10 @@ void ZoneCreator::CreateZoneAssetPools(Zone* zone) const bool ZoneCreator::SupportsGame(const std::string& gameName) const { - return gameName == g_GameIW5.GetShortName(); + auto shortName = g_GameIW5.GetShortName(); + utils::MakeStringLowerCase(shortName); + + return gameName == shortName; } std::unique_ptr ZoneCreator::CreateZoneForDefinition(ZoneCreationContext& context) const diff --git a/src/Linker/Game/T5/ZoneCreatorT5.cpp b/src/Linker/Game/T5/ZoneCreatorT5.cpp index e99514a4..c08daea4 100644 --- a/src/Linker/Game/T5/ZoneCreatorT5.cpp +++ b/src/Linker/Game/T5/ZoneCreatorT5.cpp @@ -4,6 +4,7 @@ #include "Game/T5/GameAssetPoolT5.h" #include "Game/T5/GameT5.h" #include "ObjLoading.h" +#include "Utils/StringUtils.h" #include @@ -59,7 +60,10 @@ void ZoneCreator::CreateZoneAssetPools(Zone* zone) const bool ZoneCreator::SupportsGame(const std::string& gameName) const { - return gameName == g_GameT5.GetShortName(); + auto shortName = g_GameT5.GetShortName(); + utils::MakeStringLowerCase(shortName); + + return gameName == shortName; } std::unique_ptr ZoneCreator::CreateZoneForDefinition(ZoneCreationContext& context) const