From 882eaef4c76e85142af9201ee1586a03646f7c13 Mon Sep 17 00:00:00 2001 From: Mohab <133429578+MohabCodeX@users.noreply.github.com> Date: Wed, 19 Aug 2026 00:58:50 +0300 Subject: [PATCH] fix(ped): fix crouchbug firing delay when crouchbug or fastfire glitch is enabled Allow immediate weapon firing and crouching when GLITCH_CROUCHBUG or GLITCH_FASTFIRE is enabled by making fire-key and crouch-key suppression conditional on the glitch state. Fixes #2715 --- Client/mods/deathmatch/logic/CClientPed.cpp | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index 2ea0a983967..4fc05884196 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -3178,23 +3178,29 @@ void CClientPed::ApplyControllerStateFixes(CControllerState& Current) Current.ButtonSquare = 0; Current.ButtonCross = 0; } - // Disable the fire keys whilst crouching as well - Current.ButtonCircle = 0; - Current.LeftShoulder1 = 0; + // Disable the fire keys whilst crouching as well unless crouchbug or fastfire glitch is enabled + if (!g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_CROUCHBUG) && !g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_FASTFIRE)) + { + Current.ButtonCircle = 0; + Current.LeftShoulder1 = 0; + } if (m_ulLastTimeBeganCrouch >= ulNow - 400.0f * fSpeedRatio) { - // Disable double crouching (another anim cut) - if (g_pClientGame->IsUsingAlternatePulseOrder()) - Current.ShockButtonL = 255; // Do this differently if we have changed the pulse order - else - Current.ShockButtonL = 0; + // Disable double crouching (another anim cut) unless glitch is enabled + if (!g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_CROUCHBUG) && !g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_FASTFIRE)) + { + if (g_pClientGame->IsUsingAlternatePulseOrder()) + Current.ShockButtonL = 255; // Do this differently if we have changed the pulse order + else + Current.ShockButtonL = 0; + } } } } - // If we just started aiming, make sure they dont try and crouch + // If we just started aiming, make sure they dont try and crouch unless crouchbug or fastfire is enabled else if ((m_ulLastTimeBeganAiming != 0 && m_ulLastTimeBeganAiming >= ulNow - 300.0f * fSpeedRatio) || (ulNow - m_ulLastTimeFired) <= 300.0f * fSpeedRatio) { - if (!g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_FASTFIRE)) + if (!g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_CROUCHBUG) && !g_pClientGame->IsGlitchEnabled(CClientGame::GLITCH_FASTFIRE)) { Current.ShockButtonL = 0; }