diff --git a/src/client/component/gameplay.cpp b/src/client/component/gameplay.cpp index 8bbfb5d2..87fb26c7 100644 --- a/src/client/component/gameplay.cpp +++ b/src/client/component/gameplay.cpp @@ -234,6 +234,11 @@ namespace gameplay a.jmp(0x2BD71C_b); }); } + + void jump_start_stub(game::pmove_t* pm, game::pml_t* pml, float /*height*/) + { + utils::hook::invoke(0x2BD800_b, pm, pml, dvars::jump_height->current.value); + } } class component final : public component_interface @@ -286,6 +291,10 @@ namespace gameplay utils::hook::jump(0x2BD70C_b, jump_push_off_ladder(), true); utils::hook::nop(0x2BD718_b, 4); // Nop skipped opcodes + dvars::jump_height = dvars::register_float("jump_height", 39.0f, + 0.0f, 1000.0f, game::DVAR_FLAG_REPLICATED, "The maximum height of a player\'s jump"); + utils::hook::call(0x2BD22D_b, jump_start_stub); + jump_apply_slowdown_hook.create(0x2BD0B0_b, jump_apply_slowdown_stub); jump_slowDownEnable = dvars::register_bool("jump_slowDownEnable", true, game::DVAR_FLAG_REPLICATED, "Slow player movement after jumping"); diff --git a/src/client/game/dvars.cpp b/src/client/game/dvars.cpp index 0919bdd4..a96ac1fb 100644 --- a/src/client/game/dvars.cpp +++ b/src/client/game/dvars.cpp @@ -34,6 +34,8 @@ namespace dvars game::dvar_t* jump_ladderPushVel = nullptr; + game::dvar_t* jump_height = nullptr; + game::dvar_t* jump_enableFallDamage; game::dvar_t* r_fullbright; diff --git a/src/client/game/dvars.hpp b/src/client/game/dvars.hpp index 3c769b50..16bb4277 100644 --- a/src/client/game/dvars.hpp +++ b/src/client/game/dvars.hpp @@ -37,6 +37,8 @@ namespace dvars extern game::dvar_t* jump_ladderPushVel; + extern game::dvar_t* jump_height; + extern game::dvar_t* jump_enableFallDamage; extern game::dvar_t* r_fullbright; diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index bc1d7635..7ea4d8b4 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1475,6 +1475,20 @@ namespace game static_assert(offsetof(client_state_t, ping) == 0x4A50); static_assert(offsetof(client_state_t, num_players) == 0x4A5C); + struct pmove_t + { + unsigned char __pad0[0x190]; + }; + + static_assert(sizeof(pmove_t) == 0x190); + + struct pml_t + { + unsigned char __pad0[0x130]; + }; + + static_assert(sizeof(pml_t) == 0x130); + enum PlayerHandIndex { WEAPON_HAND_DEFAULT = 0x0,