You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int *m_afButtonPressed;
bool is_buttonpressed_jump_set = false;
if (offm_afButtonPressed)
{
m_afButtonPressed = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(thisptr) + offm_afButtonPressed);
if (!(*m_afButtonPressed & IN_JUMP))
{
if (CVars::bxt_autojump.GetBool())
{
*m_afButtonPressed |= IN_JUMP;
is_buttonpressed_jump_set = true;
}
}
}
insideCBasePlayerJump = true;
ORIG_CBasePlayer__Jump(thisptr);
insideCBasePlayerJump = false;
if (is_buttonpressed_jump_set)
*m_afButtonPressed &= ~IN_JUMP;
At the same time, this will also add the ability to use bxt_autojump in pre-HLSDK 2.0 game versions (where the movement code was accessed only for server-side)
I had previously done byte patching for CoF to fix that behavior in BXT code:
But looking back I understand that it was a completely bad decision to fix it in that way, so that byte patching code can be removed as soon as the m_afButtonPressed set solution would be added
The text was updated successfully, but these errors were encountered:
SmileyAG
changed the title
Set IN_JUMP for m_afButtonPressed in CBasePlayer::Jump to fix the incorrect behavior of bxt_autojump
feature: set IN_JUMP for m_afButtonPressed in CBasePlayer::Jump to fix the incorrect behavior of bxt_autojump
Jul 29, 2024
Current behaviour with
bxt_autojump
:This happens because of this check in the
CBasePlayer::Jump
code: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/player.cpp#L1619-L1621Proposed fix:
At the same time, this will also add the ability to use
bxt_autojump
in pre-HLSDK 2.0 game versions (where the movement code was accessed only for server-side)I had previously done byte patching for CoF to fix that behavior in BXT code:
BunnymodXT/BunnymodXT/modules/ServerDLL.cpp
Lines 1832 to 1836 in 1196334
But looking back I understand that it was a completely bad decision to fix it in that way, so that byte patching code can be removed as soon as the
m_afButtonPressed
set solution would be addedThe text was updated successfully, but these errors were encountered: