From 0b1120f26f7c594c5c9ffe86e5fbf0c4c34df48e Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 14 Dec 2023 18:29:09 +0100 Subject: [PATCH] Add menu base function as lowercase to the function map to enable case-insensitivity --- .../Parsing/Menu/Matcher/MenuExpressionMatchers.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp b/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp index 9ec73c37..b5acb8ac 100644 --- a/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp +++ b/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp @@ -58,7 +58,11 @@ const std::map& MenuExpressionMatchers::GetBaseFunctionMapF if (!iw4FunctionMapInitialized) { for (size_t i = IW4::expressionFunction_e::EXP_FUNC_DYN_START; i < std::extent_v; i++) - iw4FunctionMap.emplace(std::make_pair(IW4::g_expFunctionNames[i], i)); + { + std::string functionName(IW4::g_expFunctionNames[i]); + utils::MakeStringLowerCase(functionName); + iw4FunctionMap.emplace(std::make_pair(functionName, i)); + } } return iw4FunctionMap; @@ -71,7 +75,11 @@ const std::map& MenuExpressionMatchers::GetBaseFunctionMapF if (!iw5FunctionMapInitialized) { for (size_t i = IW5::expressionFunction_e::EXP_FUNC_DYN_START; i < std::extent_v; i++) - iw5FunctionMap.emplace(std::make_pair(IW5::g_expFunctionNames[i], i)); + { + std::string functionName(IW5::g_expFunctionNames[i]); + utils::MakeStringLowerCase(functionName); + iw5FunctionMap.emplace(std::make_pair(std::move(functionName), i)); + } } return iw5FunctionMap;