Skip to content

Commit

Permalink
fix: INFRA vphys
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Oct 3, 2024
1 parent 142807f commit 7af6ddd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
13 changes: 0 additions & 13 deletions src/Features/Hud/VphysHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -172,9 +171,6 @@ CON_COMMAND(sar_vphys_setgravity, "sar_vphys_setgravity <hitbox> <enabled> - 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);
Expand Down Expand Up @@ -208,9 +204,6 @@ CON_COMMAND(sar_vphys_setangle, "sar_vphys_setangle <hitbox> <angle> [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);
Expand Down Expand Up @@ -261,9 +254,6 @@ CON_COMMAND(sar_vphys_setspin, "sar_vphys_setspin <hitbox> <angvel> [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);
Expand Down Expand Up @@ -313,9 +303,6 @@ CON_COMMAND(sar_vphys_setasleep, "sar_vphys_setasleep <hitbox> <asleep> - 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);
Expand Down
2 changes: 2 additions & 0 deletions src/Offsets/INFRA 6905.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/Offsets/Portal 2 8491.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 7af6ddd

Please sign in to comment.