mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-04-20 13:05:42 +00:00
Merge pull request #3 from diamante0018/main
Add unlimited sprint toggle via gsc
This commit is contained in:
commit
d4c8a7ce2c
2
deps/GSL
vendored
2
deps/GSL
vendored
@ -1 +1 @@
|
||||
Subproject commit c1cbb41b428f15e53454682a45f03ea31f1da0a7
|
||||
Subproject commit c31a9ad5e8e99da8567237a7ba51a7d8f419e5bf
|
@ -343,6 +343,25 @@ namespace gsc
|
||||
return {};
|
||||
});
|
||||
|
||||
method::add("specialtymarathon", [](const game::scr_entref_t ent, const function_args& args) -> scripting::script_value
|
||||
{
|
||||
if (ent.classnum != 0)
|
||||
{
|
||||
throw std::runtime_error("Invalid entity");
|
||||
}
|
||||
|
||||
const auto num = ent.entnum;
|
||||
const auto toggle = args[0].as<int>();
|
||||
|
||||
auto g_client = game::g_entities[num].client;
|
||||
auto playerState = &g_client->ps;
|
||||
auto flags = playerState->perks[0];
|
||||
|
||||
playerState->perks[0] = toggle
|
||||
? flags | 0x4000u
|
||||
: flags & ~0x4000u;
|
||||
});
|
||||
|
||||
utils::hook::jump(0x56C8EB, call_builtin_stub);
|
||||
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
|
||||
utils::hook::jump(0x56B726, vm_execute_stub);
|
||||
@ -350,4 +369,4 @@ namespace gsc
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(gsc::component)
|
||||
REGISTER_COMPONENT(gsc::component)
|
||||
|
@ -303,8 +303,23 @@ namespace game
|
||||
dvar_t* hashNext;
|
||||
};
|
||||
|
||||
struct playerState_s
|
||||
{
|
||||
char __pad0[1260];
|
||||
unsigned int perks[2];
|
||||
unsigned int perkSlots[9];
|
||||
char __pad1[11752];
|
||||
};
|
||||
|
||||
struct gclient_s
|
||||
{
|
||||
playerState_s ps;
|
||||
};
|
||||
|
||||
struct gentity_s
|
||||
{
|
||||
int entnum;
|
||||
char __pad0[340];
|
||||
gclient_s* client;
|
||||
};
|
||||
}
|
@ -74,7 +74,7 @@ namespace game
|
||||
|
||||
WEAK symbol<scr_classStruct_t*> g_classMap{0x8B4300};
|
||||
|
||||
WEAK symbol<gentity_s> g_entities{0x0};
|
||||
WEAK symbol<gentity_s> g_entities{0x1A66E28};
|
||||
WEAK symbol<unsigned int> levelEntityId{0x208E1A4};
|
||||
|
||||
namespace plutonium
|
||||
|
Loading…
x
Reference in New Issue
Block a user