From 94d0c7e0bdc83ee6e1d18013a1f282acc7ab15c1 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Sun, 13 Aug 2023 05:32:11 +0200 Subject: [PATCH] Better fix --- src/client/component/camera.cpp | 10 +--------- src/client/game/structs.hpp | 5 ++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/client/component/camera.cpp b/src/client/component/camera.cpp index a68b317b..ae341ce7 100644 --- a/src/client/component/camera.cpp +++ b/src/client/component/camera.cpp @@ -53,14 +53,6 @@ namespace camera return; } - if (cg_paused->modified) - { - ps->origin[0] = game::refdef->org[0]; - ps->origin[1] = game::refdef->org[1]; - ps->origin[2] = game::refdef->org[2]; - cg_paused->modified = false; - } - float viewangles[3]{}; viewangles[0] = angle_normalize((cmd.angles[0] * 0.000021457672f) + ps->delta_angles[0]); viewangles[1] = angle_normalize((cmd.angles[1] * 0.000021457672f) + ps->delta_angles[1]); @@ -124,7 +116,7 @@ namespace camera game::refdef->org[0] = ps->origin[0]; game::refdef->org[1] = ps->origin[1]; - game::refdef->org[2] = ps->origin[2]; + game::refdef->org[2] = ps->origin[2] + ps->viewHeightCurrent; } void set_viewpos_now_stub(void* a1) diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index 18315e08..f4ed06c6 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -752,11 +752,14 @@ namespace game char __pad2[40]; vec3_t origin; vec3_t velocity; - char __pad3[144]; + char __pad3[128]; + float viewHeightCurrent; + char __pad4[12]; vec3_t delta_angles; }; static_assert(offsetof(playerState_s, origin) == 128); + static_assert(offsetof(playerState_s, viewHeightCurrent) == 280); static_assert(offsetof(playerState_s, delta_angles) == 296); struct SprintState_s