From 05be91f6bc214054d6b434474e6d39a053f624b4 Mon Sep 17 00:00:00 2001 From: alice <58637860+alicealys@users.noreply.github.com> Date: Tue, 19 Aug 2025 05:27:31 +0200 Subject: [PATCH] fix #25 --- src/component/command.cpp | 6 +----- src/component/gsc.cpp | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/component/command.cpp b/src/component/command.cpp index 428b7f8..bec33ed 100644 --- a/src/component/command.cpp +++ b/src/component/command.cpp @@ -11,7 +11,6 @@ #include #include #include -#include namespace command { @@ -272,10 +271,7 @@ namespace command { scripting::on_shutdown(clear); - if (!utils::flags::has_flag("disable-client-command")) - { - client_command_hook.create(SELECT_VALUE(0x4AF770, 0x63DB70), client_command_stub); - } + client_command_hook.create(SELECT_VALUE(0x4AF770, 0x63DB70), client_command_stub); gsc::function::add_multiple([](const std::string& command) { diff --git a/src/component/gsc.cpp b/src/component/gsc.cpp index 284e132..7bb94d8 100644 --- a/src/component/gsc.cpp +++ b/src/component/gsc.cpp @@ -126,6 +126,7 @@ namespace gsc // Scr_NotifyId doesn't exist, Scr_NotifyNum_Internal calls FindVariableId to get the variable id from entnum, classnum & clientNum // to not have to recreate Scr_NotifyId we simply make FindVariableId return `entnum` (which in this case will be the id) if `clientNum` == -1 + std::size_t find_variable_id_stub_plutonium = 0; unsigned int find_variable_id_stub(int inst, int entnum, unsigned int classnum, int client_num) { if (client_num == -1) @@ -133,7 +134,7 @@ namespace gsc return entnum; } - return utils::hook::invoke(SELECT_VALUE(0x5E96E0, 0x40BEF0), inst, entnum, classnum, client_num); + return utils::hook::invoke(find_variable_id_stub_plutonium, inst, entnum, classnum, client_num); } } @@ -197,6 +198,7 @@ namespace gsc utils::hook::set(SELECT_VALUE(0x9FC5C0 + 40, 0xAABA68 + 40), '\n'); utils::hook::set(SELECT_VALUE(0x9FC5C0 + 41, 0xAABA68 + 41), '\0'); + find_variable_id_stub_plutonium = utils::hook::extract(SELECT_VALUE(0x41D2B5, 0x416325) + 1); utils::hook::call(SELECT_VALUE(0x41D2B5, 0x416325), find_variable_id_stub); gsc::function::add("array", [](const scripting::variadic_args& va)