mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
save m_afButtonDisabled & m_afButtonForced in checkpoints (mainly for player_speedmod)
this makes kz_bhop_genkai a bit more bearable at times this also isn't perfect since restarting doesn't reset them
This commit is contained in:
parent
2013968f1c
commit
bf5ec55a6a
@ -346,6 +346,15 @@
|
|||||||
"linux" "\xC7\x80\x2A\x2A\x2A\x2A\x00\x00\x80\x3F\x8B\x03"
|
"linux" "\xC7\x80\x2A\x2A\x2A\x2A\x00\x00\x80\x3F\x8B\x03"
|
||||||
"linux64" "\xC7\x80\x2A\x2A\x2A\x2A\x00\x00\x80\x3F\x48\x8B\x07"
|
"linux64" "\xC7\x80\x2A\x2A\x2A\x2A\x00\x00\x80\x3F\x48\x8B\x07"
|
||||||
}
|
}
|
||||||
|
// search "sv_maxusrcmdprocessticks_warning at server" to find CPlayerMove::RunCommand
|
||||||
|
// then sig the the `mov REG1,dword ptr [REG2 + OFFSET_TO_BUTTON_DISABLED_HERE]`
|
||||||
|
"CBasePlayer->m_afButtonDisabled"
|
||||||
|
{
|
||||||
|
"windows" "\x8B\x87\x2A\x2A\x2A\x2A\xF7\xD0\x23\xC1"
|
||||||
|
"windows64" "\x8B\x87\x2A\x2A\x2A\x2A\xF7\xD0"
|
||||||
|
"linux" "\x8B\x93\x2A\x2A\x2A\x2A\xF7\xD2"
|
||||||
|
"linux64" "\x8B\x83\x2A\x2A\x2A\x2A\xF7\xD0\x21\xD0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,11 @@ enum struct cp_cache_t
|
|||||||
float m_ladderSurpressionTimer[2]; // css only // 0 = duration, 1 = remaining
|
float m_ladderSurpressionTimer[2]; // css only // 0 = duration, 1 = remaining
|
||||||
float m_lastLadderNormal[3]; // css only
|
float m_lastLadderNormal[3]; // css only
|
||||||
float m_lastLadderPos[3]; // css only
|
float m_lastLadderPos[3]; // css only
|
||||||
|
|
||||||
|
// used by player_speedmod
|
||||||
|
int m_afButtonDisabled;
|
||||||
|
// used by trigger_playermovement
|
||||||
|
int m_afButtonForced;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -111,6 +111,8 @@ int gI_Offset_m_lastStandingPos = 0;
|
|||||||
int gI_Offset_m_ladderSurpressionTimer = 0;
|
int gI_Offset_m_ladderSurpressionTimer = 0;
|
||||||
int gI_Offset_m_lastLadderNormal = 0;
|
int gI_Offset_m_lastLadderNormal = 0;
|
||||||
int gI_Offset_m_lastLadderPos = 0;
|
int gI_Offset_m_lastLadderPos = 0;
|
||||||
|
int gI_Offset_m_afButtonDisabled = 0;
|
||||||
|
int gI_Offset_m_afButtonForced = 0;
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
@ -227,7 +229,7 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
void LoadDHooks()
|
void LoadDHooks()
|
||||||
{
|
{
|
||||||
Handle hGameData = LoadGameConfigFile("shavit.games");
|
GameData hGameData = new GameData("shavit.games");
|
||||||
|
|
||||||
if (hGameData == null)
|
if (hGameData == null)
|
||||||
{
|
{
|
||||||
@ -259,6 +261,18 @@ void LoadDHooks()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Address buttonsSig = hGameData.GetMemSig("CBasePlayer->m_afButtonDisabled");
|
||||||
|
if (buttonsSig == Address_Null)
|
||||||
|
{
|
||||||
|
SetFailState("Couldn't find signature of CBasePlayer->m_afButtonDisabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
int instr = LoadFromAddress(buttonsSig, NumberType_Int32);
|
||||||
|
// The lowest two bytes are the beginning of a `mov`.
|
||||||
|
// The offset is 100% definitely totally always 16-bit.
|
||||||
|
gI_Offset_m_afButtonDisabled = instr >> 16;
|
||||||
|
gI_Offset_m_afButtonForced = gI_Offset_m_afButtonDisabled + 4;
|
||||||
|
|
||||||
delete hGameData;
|
delete hGameData;
|
||||||
hGameData = LoadGameConfigFile("sdktools.games");
|
hGameData = LoadGameConfigFile("sdktools.games");
|
||||||
int iOffset;
|
int iOffset;
|
||||||
@ -1584,6 +1598,9 @@ void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, H
|
|||||||
cpcache.m_ignoreLadderJumpTime = GetEntPropFloat(target, Prop_Data, "m_ignoreLadderJumpTime") - GetGameTime();
|
cpcache.m_ignoreLadderJumpTime = GetEntPropFloat(target, Prop_Data, "m_ignoreLadderJumpTime") - GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cpcache.m_afButtonDisabled = GetEntData(target, gI_Offset_m_afButtonDisabled);
|
||||||
|
cpcache.m_afButtonForced = GetEntData(target, gI_Offset_m_afButtonForced);
|
||||||
|
|
||||||
cpcache.iMoveType = GetEntityMoveType(target);
|
cpcache.iMoveType = GetEntityMoveType(target);
|
||||||
cpcache.fGravity = GetEntityGravity(target);
|
cpcache.fGravity = GetEntityGravity(target);
|
||||||
cpcache.fSpeed = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue");
|
cpcache.fSpeed = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue");
|
||||||
@ -1864,6 +1881,9 @@ bool LoadCheckpointCache(int client, cp_cache_t cpcache, int index, bool force =
|
|||||||
SetEntPropFloat(client, Prop_Send, "m_flDuckSpeed", cpcache.fDuckSpeed);
|
SetEntPropFloat(client, Prop_Send, "m_flDuckSpeed", cpcache.fDuckSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetEntData(client, gI_Offset_m_afButtonDisabled, cpcache.m_afButtonDisabled);
|
||||||
|
SetEntData(client, gI_Offset_m_afButtonForced, cpcache.m_afButtonForced);
|
||||||
|
|
||||||
// this is basically the same as normal checkpoints except much less data is used
|
// this is basically the same as normal checkpoints except much less data is used
|
||||||
if(!isPersistentData && Shavit_GetStyleSettingInt(gI_Style[client], "kzcheckpoints"))
|
if(!isPersistentData && Shavit_GetStyleSettingInt(gI_Style[client], "kzcheckpoints"))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user