From 4156bacf2aa9a0b78bef21c4730cb6be472e90f7 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Fri, 25 Feb 2022 12:37:01 +0000 Subject: [PATCH] Use key from map when searching for custom func --- src/Components/Modules/Script.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Modules/Script.cpp b/src/Components/Modules/Script.cpp index 23aae4a2..e72021cd 100644 --- a/src/Components/Modules/Script.cpp +++ b/src/Components/Modules/Script.cpp @@ -295,7 +295,7 @@ namespace Components { for (const auto& [key, value] : Script::CustomScrFunctions) { - Game::Scr_RegisterFunction(reinterpret_cast(value.actionFunc), value.actionString); + Game::Scr_RegisterFunction(reinterpret_cast(value.actionFunc), key.data()); } return Utils::Hook::Call(0x44E700)(pName, type); // Scr_GetFunction @@ -305,7 +305,7 @@ namespace Components { for (const auto& [key, value] : Script::CustomScrMethods) { - Game::Scr_RegisterFunction(reinterpret_cast(value.actionFunc), value.actionString); + Game::Scr_RegisterFunction(reinterpret_cast(value.actionFunc), key.data()); } return Utils::Hook::Call(0x4EC870)(pName, type); // Scr_GetMethod @@ -315,7 +315,7 @@ namespace Components { if (pName && *pName) { - const auto got = Script::CustomScrFunctions.find(*pName); + const auto got = Script::CustomScrFunctions.find(Utils::String::ToLower(*pName)); // If no function was found let's call game's function if (got != Script::CustomScrFunctions.end()) @@ -332,7 +332,7 @@ namespace Components { if (pName && *pName) { - const auto got = Script::CustomScrMethods.find(*pName); + const auto got = Script::CustomScrMethods.find(Utils::String::ToLower(*pName)); // If no method was found let's call game's function if (got != Script::CustomScrMethods.end())