mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2025-08-30 05:13:17 +00:00
fix #25
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
#include <utils/memory.hpp>
|
#include <utils/memory.hpp>
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
#include <utils/flags.hpp>
|
|
||||||
|
|
||||||
namespace command
|
namespace command
|
||||||
{
|
{
|
||||||
@@ -272,10 +271,7 @@ namespace command
|
|||||||
{
|
{
|
||||||
scripting::on_shutdown(clear);
|
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)
|
gsc::function::add_multiple([](const std::string& command)
|
||||||
{
|
{
|
||||||
|
@@ -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
|
// 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
|
// 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)
|
unsigned int find_variable_id_stub(int inst, int entnum, unsigned int classnum, int client_num)
|
||||||
{
|
{
|
||||||
if (client_num == -1)
|
if (client_num == -1)
|
||||||
@@ -133,7 +134,7 @@ namespace gsc
|
|||||||
return entnum;
|
return entnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
return utils::hook::invoke<unsigned int>(SELECT_VALUE(0x5E96E0, 0x40BEF0), inst, entnum, classnum, client_num);
|
return utils::hook::invoke<unsigned int>(find_variable_id_stub_plutonium, inst, entnum, classnum, client_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +198,7 @@ namespace gsc
|
|||||||
utils::hook::set<char>(SELECT_VALUE(0x9FC5C0 + 40, 0xAABA68 + 40), '\n');
|
utils::hook::set<char>(SELECT_VALUE(0x9FC5C0 + 40, 0xAABA68 + 40), '\n');
|
||||||
utils::hook::set<char>(SELECT_VALUE(0x9FC5C0 + 41, 0xAABA68 + 41), '\0');
|
utils::hook::set<char>(SELECT_VALUE(0x9FC5C0 + 41, 0xAABA68 + 41), '\0');
|
||||||
|
|
||||||
|
find_variable_id_stub_plutonium = utils::hook::extract<size_t>(SELECT_VALUE(0x41D2B5, 0x416325) + 1);
|
||||||
utils::hook::call(SELECT_VALUE(0x41D2B5, 0x416325), find_variable_id_stub);
|
utils::hook::call(SELECT_VALUE(0x41D2B5, 0x416325), find_variable_id_stub);
|
||||||
|
|
||||||
gsc::function::add("array", [](const scripting::variadic_args& va)
|
gsc::function::add("array", [](const scripting::variadic_args& va)
|
||||||
|
Reference in New Issue
Block a user