From 7af6ddd9173e46ca22b80fa3756bf1fe90b2c94e Mon Sep 17 00:00:00 2001 From: AMJ <69196954+ThisAMJ@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:30:56 +1000 Subject: [PATCH] fix: INFRA vphys --- src/Features/Hud/VphysHud.cpp | 13 ------------- src/Offsets/INFRA 6905.hpp | 2 ++ src/Offsets/Portal 2 8491.hpp | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Features/Hud/VphysHud.cpp b/src/Features/Hud/VphysHud.cpp index 64f9bb47e..3e5ef5bc7 100644 --- a/src/Features/Hud/VphysHud.cpp +++ b/src/Features/Hud/VphysHud.cpp @@ -88,7 +88,6 @@ VphysShadowInfo VphysHud::GetVphysInfo(int slot, bool crouched) { info.player = server->GetPlayer(slot + 1); if (!info.player) return info; - if (sar.game->Is(SourceGame_INFRA)) return info; int hitboxOffset = crouched ? Offsets::m_pShadowCrouch : Offsets::m_pShadowStand; @@ -172,9 +171,6 @@ CON_COMMAND(sar_vphys_setgravity, "sar_vphys_setgravity - set if (!sv_cheats.GetBool()) { return console->Print("Cannot use sar_vphys_setgravity without sv_cheats set to 1.\n"); } - if (sar.game->Is(SourceGame_INFRA)) { - return console->Print("This command is not yet supported in INFRA.\n"); - } if (args.ArgC() != 3) { return console->Print(sar_vphys_setgravity.ThisPtr()->m_pszHelpString); @@ -208,9 +204,6 @@ CON_COMMAND(sar_vphys_setangle, "sar_vphys_setangle [component if (!sv_cheats.GetBool()) { return console->Print("Cannot use sar_vphys_setangle without sv_cheats set to 1.\n"); } - if (sar.game->Is(SourceGame_INFRA)) { - return console->Print("This command is not yet supported in INFRA.\n"); - } if (args.ArgC() < 3 || args.ArgC() > 4) { return console->Print(sar_vphys_setangle.ThisPtr()->m_pszHelpString); @@ -261,9 +254,6 @@ CON_COMMAND(sar_vphys_setspin, "sar_vphys_setspin [component = if (!sv_cheats.GetBool()) { return console->Print("Cannot use sar_vphys_setspin without sv_cheats set to 1.\n"); } - if (sar.game->Is(SourceGame_INFRA)) { - return console->Print("This command is not yet supported in INFRA.\n"); - } if (args.ArgC() < 3 || args.ArgC() > 4) { return console->Print(sar_vphys_setspin.ThisPtr()->m_pszHelpString); @@ -313,9 +303,6 @@ CON_COMMAND(sar_vphys_setasleep, "sar_vphys_setasleep - sets w if (!sv_cheats.GetBool()) { return console->Print("Cannot use sar_vphys_setasleep without sv_cheats set to 1.\n"); } - if (sar.game->Is(SourceGame_INFRA)) { - return console->Print("This command is not yet supported in INFRA.\n"); - } if (args.ArgC() != 3) { return console->Print(sar_vphys_setasleep.ThisPtr()->m_pszHelpString); diff --git a/src/Offsets/INFRA 6905.hpp b/src/Offsets/INFRA 6905.hpp index 3179dfa5a..428bab3f8 100644 --- a/src/Offsets/INFRA 6905.hpp +++ b/src/Offsets/INFRA 6905.hpp @@ -43,6 +43,8 @@ OFFSET_WINDOWS(TryPlayerMove, 38) OFFSET_WINDOWS(viewangles, 35424) // CBasePlayer +OFFSET_WINDOWS(m_pShadowStand, 3200) +OFFSET_WINDOWS(m_pShadowCrouch, 3204) OFFSET_WINDOWS(S_m_surfaceFriction, 4156) OFFSET_WINDOWS(C_m_surfaceFriction, 5652) diff --git a/src/Offsets/Portal 2 8491.hpp b/src/Offsets/Portal 2 8491.hpp index 04207d545..66126ed5d 100644 --- a/src/Offsets/Portal 2 8491.hpp +++ b/src/Offsets/Portal 2 8491.hpp @@ -156,8 +156,8 @@ OFFSET_DEFAULT(GetPredDescMap, 17, 20) // CBasePlayer OFFSET_DEFAULT(m_pSurfaceData, 3868, 4116) -OFFSET_DEFAULT(m_pShadowStand, 3160, 3184) -OFFSET_DEFAULT(m_pShadowCrouch, 3164, 3188) +OFFSET_DEFAULT(m_pShadowStand, 3160, 3184) // "player_stand" -> CBasePlayer::InitVCollision -> CBasePlayer::SetupVPhysicsShadow -> usage of pStandHullName -> vtable offset write +OFFSET_DEFAULT(m_pShadowCrouch, 3164, 3188) // ^ "player_crouch" pCrouchHullName OFFSET_DEFAULT(S_m_surfaceFriction, 4096, 4120) OFFSET_DEFAULT(C_m_surfaceFriction, 5548, 5520)