From 1aa2a0ce0c450fecaad65cc921557723f43aca42 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Tue, 30 Aug 2022 19:37:46 +0200 Subject: [PATCH] Small fix --- src/client/component/gsc.cpp | 8 +++----- src/client/game/scripting/functions.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/client/component/gsc.cpp b/src/client/component/gsc.cpp index d82e4455..c094eddb 100644 --- a/src/client/component/gsc.cpp +++ b/src/client/component/gsc.cpp @@ -356,9 +356,7 @@ namespace gsc return {}; } - const auto value = &game::scr_VmPub->top[-index]; - - return scripting::script_value(*value); + return game::scr_VmPub->top[-index]; } auto function_id_start = 0x320; @@ -379,7 +377,7 @@ namespace gsc void execute_custom_function(scripting::script_function function) { - bool error = false; + auto error = false; try { @@ -400,7 +398,7 @@ namespace gsc void vm_call_builtin_stub(scripting::script_function function) { - bool custom = false; + auto custom = false; { custom = functions.find(function) != functions.end(); } diff --git a/src/client/game/scripting/functions.cpp b/src/client/game/scripting/functions.cpp index 5b7720f1..12680dc2 100644 --- a/src/client/game/scripting/functions.cpp +++ b/src/client/game/scripting/functions.cpp @@ -64,7 +64,7 @@ namespace scripting static const auto function_table = &gsc::func_table; static const auto method_table = 0x14B155890; - if (index < 0x320) + if (index < 0x1000) { return reinterpret_cast(function_table)[index - 1]; }