From 158f0b854621ad208458ea73db545535d8af27a4 Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Thu, 21 Apr 2022 13:22:44 +0000 Subject: [PATCH] disable the extra css ladder stuff from checkpoints for now --- addons/sourcemod/gamedata/shavit.games.txt | 4 ++-- addons/sourcemod/scripting/include/shavit/checkpoints.inc | 5 +++++ addons/sourcemod/scripting/shavit-checkpoints.sp | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/gamedata/shavit.games.txt b/addons/sourcemod/gamedata/shavit.games.txt index 74488cae..295515fe 100644 --- a/addons/sourcemod/gamedata/shavit.games.txt +++ b/addons/sourcemod/gamedata/shavit.games.txt @@ -152,8 +152,8 @@ // find in CCSGameMovement::CheckForLadders which references CCSPlayer::CanGrabLadder "CCSPlayer::m_lastStandingPos" { - "windows" "5688" - "linux" "5704" + "windows" "5684" + "linux" "5704" // +20 wow that's easy! } // find CCSPlayer::CanGrabLadder via 4096.0f or symbols on linux... "CCSPlayer::m_ladderSurpressionTimer" diff --git a/addons/sourcemod/scripting/include/shavit/checkpoints.inc b/addons/sourcemod/scripting/include/shavit/checkpoints.inc index 8627be75..6707b0e1 100644 --- a/addons/sourcemod/scripting/include/shavit/checkpoints.inc +++ b/addons/sourcemod/scripting/include/shavit/checkpoints.inc @@ -23,6 +23,9 @@ #endif #define _shavit_checkpoints_included +// disabled for now since it's a lot of bytes to add +#define MORE_LADDER_CHECKPOINT_STUFF 0 + enum struct cp_cache_t { float fPosition[3]; @@ -53,10 +56,12 @@ enum struct cp_cache_t bool m_bHasWalkMovedSinceLastJump; // csgo only float m_ignoreLadderJumpTime; // csgo only +#if MORE_LADDER_CHECKPOINT_STUFF float m_lastStandingPos[3]; // css only float m_ladderSurpressionTimer[2]; // css only // 0 = duration, 1 = remaining float m_lastLadderNormal[3]; // css only float m_lastLadderPos[3]; // css only +#endif } /** diff --git a/addons/sourcemod/scripting/shavit-checkpoints.sp b/addons/sourcemod/scripting/shavit-checkpoints.sp index 08dc48b1..6125245b 100644 --- a/addons/sourcemod/scripting/shavit-checkpoints.sp +++ b/addons/sourcemod/scripting/shavit-checkpoints.sp @@ -103,10 +103,12 @@ bool gB_ReplayRecorder = false; DynamicHook gH_CommitSuicide = null; float gF_NextSuicide[MAXPLAYERS+1]; +#if MORE_LADDER_CHECKPOINT_STUFF int gI_Offset_m_lastStandingPos = 0; int gI_Offset_m_ladderSurpressionTimer = 0; int gI_Offset_m_lastLadderNormal = 0; int gI_Offset_m_lastLadderPos = 0; +#endif public Plugin myinfo = { @@ -232,6 +234,7 @@ void LoadDHooks() if (gEV_Type == Engine_CSS) { +#if MORE_LADDER_CHECKPOINT_STUFF if ((gI_Offset_m_lastStandingPos = GameConfGetOffset(hGameData, "CCSPlayer::m_lastStandingPos")) == -1) { SetFailState("Couldn't get the offset for \"CCSPlayer::m_lastStandingPos\"!"); @@ -251,6 +254,7 @@ void LoadDHooks() { SetFailState("Couldn't get the offset for \"CCSPlayer::m_lastLadderPos\"!"); } +#endif } delete hGameData; @@ -1412,11 +1416,13 @@ void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, H if (gEV_Type == Engine_CSS) { +#if MORE_LADDER_CHECKPOINT_STUFF GetEntDataVector(target, gI_Offset_m_lastStandingPos, cpcache.m_lastStandingPos); cpcache.m_ladderSurpressionTimer[0] = GetEntDataFloat(target, gI_Offset_m_ladderSurpressionTimer + 4); cpcache.m_ladderSurpressionTimer[1] = GetEntDataFloat(target, gI_Offset_m_ladderSurpressionTimer + 8) - GetGameTime(); GetEntDataVector(target, gI_Offset_m_lastLadderNormal, cpcache.m_lastLadderNormal); GetEntDataVector(target, gI_Offset_m_lastLadderPos, cpcache.m_lastLadderPos); +#endif } else if (gEV_Type == Engine_CSGO) { @@ -1690,11 +1696,13 @@ bool LoadCheckpointCache(int client, cp_cache_t cpcache, int index, bool force = if(gEV_Type == Engine_CSS) { +#if MORE_LADDER_CHECKPOINT_STUFF SetEntDataVector(client, gI_Offset_m_lastStandingPos, cpcache.m_lastStandingPos); SetEntDataFloat(client, gI_Offset_m_ladderSurpressionTimer + 4, cpcache.m_ladderSurpressionTimer[0]); SetEntDataFloat(client, gI_Offset_m_ladderSurpressionTimer + 8, cpcache.m_ladderSurpressionTimer[1] + GetGameTime()); SetEntDataVector(client, gI_Offset_m_lastLadderNormal, cpcache.m_lastLadderNormal); SetEntDataVector(client, gI_Offset_m_lastLadderPos, cpcache.m_lastLadderPos); +#endif SetEntPropFloat(client, Prop_Send, "m_flDucktime", cpcache.fDucktime); } else if(gEV_Type == Engine_CSGO)