From 92559b23df45fc741f5c7f2e9688e0df181ce2c9 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:42:04 +0100 Subject: [PATCH] Small fix --- src/client/component/gsc/script_extension.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/component/gsc/script_extension.cpp b/src/client/component/gsc/script_extension.cpp index b6710c49..a5a7e86d 100644 --- a/src/client/component/gsc/script_extension.cpp +++ b/src/client/component/gsc/script_extension.cpp @@ -28,7 +28,7 @@ namespace gsc using std::runtime_error::runtime_error; }; - std::unordered_map functions; + std::unordered_map functions; bool force_error_print = false; std::optional gsc_error_msg; @@ -39,7 +39,7 @@ namespace gsc { const auto result = utils::hook::invoke(0x140509F20, p_name, type); - for (const auto& [func, id] : functions) + for (const auto& [id, func] : functions) { game::Scr_RegisterFunction(func, 0, id); } @@ -251,12 +251,12 @@ namespace gsc if (gsc_ctx->func_exists(name)) { const auto id = gsc_ctx->func_id(name); - functions[function] = id; + functions[id] = function; } else { const auto id = ++function_id_start; - functions[function] = id; + functions[id] = function; gsc_ctx->func_add(name, id); } }