From 3b8c8dda4272267d679b1639e813cdedcbd8fedb Mon Sep 17 00:00:00 2001 From: panelafoda Date: Fri, 5 Jan 2024 07:52:30 -0300 Subject: [PATCH] raise max value of view_pitch dvars and makes the game use them raise max value of view_pitch dvars and makes the game use them --- src/client/component/backflips.cpp | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/client/component/backflips.cpp diff --git a/src/client/component/backflips.cpp b/src/client/component/backflips.cpp new file mode 100644 index 00000000..f793de01 --- /dev/null +++ b/src/client/component/backflips.cpp @@ -0,0 +1,43 @@ +#include +#include "loader/component_loader.hpp" +#include "game/game.hpp" + +#include +#include "dvars.hpp" + +namespace backflips +{ + //returning 1 makes the game use the dvar value instead of hardcoded value + int UseViewPitchDvars() + { + return 1; + } + + class component final : public component_interface + { + public: + void post_unpack() override + { + utils::hook::call(0xB6E70A_b, UseViewPitchDvars); + + utils::hook::call(0x6F5CF0_b, UseViewPitchDvars); + utils::hook::call(0x6F5D1A_b, UseViewPitchDvars); + + utils::hook::call(0x6E6823_b, UseViewPitchDvars); + + utils::hook::call(0x5B5BBB_b, UseViewPitchDvars); + utils::hook::call(0x5B5BE0_b, UseViewPitchDvars); + + utils::hook::call(0x154E81_b, UseViewPitchDvars); + utils::hook::call(0x154EA1_b, UseViewPitchDvars); + + utils::hook::call(0x5651E_b, UseViewPitchDvars); + utils::hook::call(0x56555_b, UseViewPitchDvars); + + dvars::override::register_float("player_view_pitch_down", 85, 0, 360, game::DVAR_FLAG_SAVED); + dvars::override::register_float("player_view_pitch_up", 85, 0, 360, game::DVAR_FLAG_SAVED); + } + }; +} + +REGISTER_COMPONENT(backflips::component) \ No newline at end of file