Skip to content

Commit

Permalink
We will ALWAYS have the extra CSS ladder checkpoint variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Mar 6, 2025
1 parent 90a6714 commit 2013968
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions addons/sourcemod/scripting/include/shavit/checkpoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#endif
#define _shavit_checkpoints_included

#define MORE_LADDER_CHECKPOINT_STUFF 1

enum struct cp_cache_t
{
float fPosition[3];
Expand Down Expand Up @@ -59,12 +57,10 @@ 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
}

/**
Expand Down
8 changes: 0 additions & 8 deletions addons/sourcemod/scripting/shavit-checkpoints.sp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ 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 =
{
Expand Down Expand Up @@ -240,7 +238,6 @@ 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\"!");
Expand All @@ -260,7 +257,6 @@ void LoadDHooks()
{
SetFailState("Couldn't get the offset for \"CCSPlayer::m_lastLadderPos\"!");
}
#endif
}

delete hGameData;
Expand Down Expand Up @@ -1576,13 +1572,11 @@ 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)
{
Expand Down Expand Up @@ -1855,13 +1849,11 @@ 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)
Expand Down

0 comments on commit 2013968

Please sign in to comment.