@@ -111,6 +111,8 @@ int gI_Offset_m_lastStandingPos = 0;
111
111
int gI_Offset_m_ladderSurpressionTimer = 0 ;
112
112
int gI_Offset_m_lastLadderNormal = 0 ;
113
113
int gI_Offset_m_lastLadderPos = 0 ;
114
+ int gI_Offset_m_afButtonDisabled = 0 ;
115
+ int gI_Offset_m_afButtonForced = 0 ;
114
116
115
117
public Plugin myinfo =
116
118
{
@@ -227,7 +229,7 @@ public void OnPluginStart()
227
229
228
230
void LoadDHooks ()
229
231
{
230
- Handle hGameData = LoadGameConfigFile (" shavit.games" );
232
+ GameData hGameData = new GameData (" shavit.games" );
231
233
232
234
if (hGameData == null )
233
235
{
@@ -259,6 +261,18 @@ void LoadDHooks()
259
261
}
260
262
}
261
263
264
+ Address buttonsSig = hGameData .GetMemSig (" CBasePlayer->m_afButtonDisabled" );
265
+ if (buttonsSig == Address_Null )
266
+ {
267
+ SetFailState (" Couldn't find signature of CBasePlayer->m_afButtonDisabled" );
268
+ }
269
+
270
+ int instr = LoadFromAddress (buttonsSig , NumberType_Int32 );
271
+ // The lowest two bytes are the beginning of a `mov`.
272
+ // The offset is 100% definitely totally always 16-bit.
273
+ gI_Offset_m_afButtonDisabled = instr >> 16 ;
274
+ gI_Offset_m_afButtonForced = gI_Offset_m_afButtonDisabled + 4 ;
275
+
262
276
delete hGameData ;
263
277
hGameData = LoadGameConfigFile (" sdktools.games" );
264
278
int iOffset ;
@@ -1584,6 +1598,9 @@ void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, H
1584
1598
cpcache .m_ignoreLadderJumpTime = GetEntPropFloat (target , Prop_Data , " m_ignoreLadderJumpTime" ) - GetGameTime ();
1585
1599
}
1586
1600
1601
+ cpcache .m_afButtonDisabled = GetEntData (target , gI_Offset_m_afButtonDisabled );
1602
+ cpcache .m_afButtonForced = GetEntData (target , gI_Offset_m_afButtonForced );
1603
+
1587
1604
cpcache .iMoveType = GetEntityMoveType (target );
1588
1605
cpcache .fGravity = GetEntityGravity (target );
1589
1606
cpcache .fSpeed = GetEntPropFloat (target , Prop_Send , " m_flLaggedMovementValue" );
@@ -1864,6 +1881,9 @@ bool LoadCheckpointCache(int client, cp_cache_t cpcache, int index, bool force =
1864
1881
SetEntPropFloat (client , Prop_Send , " m_flDuckSpeed" , cpcache .fDuckSpeed );
1865
1882
}
1866
1883
1884
+ SetEntData (client , gI_Offset_m_afButtonDisabled , cpcache .m_afButtonDisabled );
1885
+ SetEntData (client , gI_Offset_m_afButtonForced , cpcache .m_afButtonForced );
1886
+
1867
1887
// this is basically the same as normal checkpoints except much less data is used
1868
1888
if (! isPersistentData && Shavit_GetStyleSettingInt (gI_Style [client ], " kzcheckpoints" ))
1869
1889
{
0 commit comments