From 8f5b734cbcbc118aa9d448cfc571ac99466f0207 Mon Sep 17 00:00:00 2001 From: 2vg Date: Thu, 28 May 2026 16:17:13 +0900 Subject: [PATCH 1/2] feat: duck spam --- src/detours.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/detours.cpp b/src/detours.cpp index 683881c7..8841d254 100644 --- a/src/detours.cpp +++ b/src/detours.cpp @@ -538,6 +538,8 @@ void* FASTCALL Detour_CNavMesh_GetNearestNavArea(int64_t unk1, float* unk2, unsi return CNavMesh_GetNearestNavArea(unk1, unk2, unk3, unk4, unk5, unk6, unk7); } +CConVar g_cvarFixDuckSpam("cs2f_fix_duck_spam", FCVAR_NONE, "Fix duck spamming by clamping the minimum duck speed [0 = disabled, 1 = both teams, 2 = T only, 3 = CT only]", 0, true, 0, true, CS_TEAM_CT); + void FASTCALL Detour_ProcessMovement(CCSPlayer_MovementServices* pThis, void* pMove) { CCSPlayerPawn* pPawn = pThis->GetPawn(); @@ -550,6 +552,11 @@ void FASTCALL Detour_ProcessMovement(CCSPlayer_MovementServices* pThis, void* pM if (!pController || !pController->IsConnected()) return ProcessMovement(pThis, pMove); + int iFixDuckSpam = g_cvarFixDuckSpam.Get(); + + if (iFixDuckSpam > 0 && (iFixDuckSpam == 1 || pPawn->m_iTeamNum() == iFixDuckSpam) && pThis->m_flDuckSpeed() < 4.f) + pThis->m_flDuckSpeed = 4.f; + float flSpeedMod = pController->GetZEPlayer()->GetSpeedMod(); if (flSpeedMod == 1.f) From 404ddbd343756f76dd7ac80af1055d6e53b67c04 Mon Sep 17 00:00:00 2001 From: Vauff Date: Tue, 2 Jun 2026 03:01:14 -0400 Subject: [PATCH 2/2] Match default duck speed, rename cvar & add to .cfg --- cfg/cs2fixes/cs2fixes.cfg | 3 ++- src/detours.cpp | 8 ++++---- src/patches.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cfg/cs2fixes/cs2fixes.cfg b/cfg/cs2fixes/cs2fixes.cfg index b3819b0e..f5a8ab08 100644 --- a/cfg/cs2fixes/cs2fixes.cfg +++ b/cfg/cs2fixes/cs2fixes.cfg @@ -7,7 +7,7 @@ cs2f_stopsound_enable 0 // Whether to enable stopsound cs2f_noblock_enable 0 // Whether to use player noblock, which sets debris collision on every player cs2f_noblock_grenades 0 // Whether to use noblock on grenade projectiles cs2f_block_team_messages 0 // Whether to block team join messages -cs2f_movement_unlocker_enable 0 // Whether to enable movement unlocker +cs2f_movement_unlocker_enable 0 // Whether to enable movement unlocker, clients will not predict cs2f_use_old_push 0 // Whether to use the old CSGO trigger_push behavior (Necessary for surf and other modes that heavily use ported pushes) cs2f_hide_enable 0 // Whether to enable hide (WARNING: randomly crashes clients since 2023-12-13 CS2 update) cs2f_votemanager_enable 0 // Whether to enable votemanager features such as map vote fix, nominations, RTV and extends @@ -26,6 +26,7 @@ cs2f_fix_game_bans 0 // Whether to fix CS2 game bans spreading to all new jo cs2f_free_armor 0 // Whether kevlar (1+) and/or helmet (2) are given automatically cs2f_block_particle_msgs 0 // Whether to block CUserMsg_ParticleManager messages to fix lag/crashes, experimental cs2f_disable_setmodel 0 // Whether to disable SetModel usage from maps (custom input, cs_script function) +cs2f_allow_duck_spam 0 // Whether to allow duck spamming by removing the duck slowdown, clients will only partially predict [0 = disabled, 1 = both teams, 2 = T only, 3 = CT only] cs2f_beacon_particle "particles/cs2fixes/admin_beacon.vpcf" // .vpcf file to be precached and used for player beacon cs2f_motd_url "" // Server MOTD URL, shows up as a "Server Website" button in scoreboard diff --git a/src/detours.cpp b/src/detours.cpp index 8841d254..17d4aef0 100644 --- a/src/detours.cpp +++ b/src/detours.cpp @@ -538,7 +538,7 @@ void* FASTCALL Detour_CNavMesh_GetNearestNavArea(int64_t unk1, float* unk2, unsi return CNavMesh_GetNearestNavArea(unk1, unk2, unk3, unk4, unk5, unk6, unk7); } -CConVar g_cvarFixDuckSpam("cs2f_fix_duck_spam", FCVAR_NONE, "Fix duck spamming by clamping the minimum duck speed [0 = disabled, 1 = both teams, 2 = T only, 3 = CT only]", 0, true, 0, true, CS_TEAM_CT); +CConVar g_cvarAllowDuckSpam("cs2f_allow_duck_spam", FCVAR_NONE, "Whether to allow duck spamming by removing the duck slowdown, clients will only partially predict [0 = disabled, 1 = both teams, 2 = T only, 3 = CT only]", 0, true, 0, true, CS_TEAM_CT); void FASTCALL Detour_ProcessMovement(CCSPlayer_MovementServices* pThis, void* pMove) { @@ -552,10 +552,10 @@ void FASTCALL Detour_ProcessMovement(CCSPlayer_MovementServices* pThis, void* pM if (!pController || !pController->IsConnected()) return ProcessMovement(pThis, pMove); - int iFixDuckSpam = g_cvarFixDuckSpam.Get(); + int iAllowDuckSpam = g_cvarAllowDuckSpam.Get(); - if (iFixDuckSpam > 0 && (iFixDuckSpam == 1 || pPawn->m_iTeamNum() == iFixDuckSpam) && pThis->m_flDuckSpeed() < 4.f) - pThis->m_flDuckSpeed = 4.f; + if ((iAllowDuckSpam == 1 || pPawn->m_iTeamNum() == iAllowDuckSpam) && pThis->m_flDuckSpeed() != 8.0f) + pThis->m_flDuckSpeed = 8.0f; float flSpeedMod = pController->GetZEPlayer()->GetSpeedMod(); diff --git a/src/patches.cpp b/src/patches.cpp index 86e6cbbd..573820cd 100644 --- a/src/patches.cpp +++ b/src/patches.cpp @@ -36,7 +36,7 @@ CMemPatch g_CommonPatches[] = CMemPatch("SetSchemaHammerUniqueId", "SetSchemaHammerUniqueId"), }; -CConVar cs2f_movement_unlocker_enable("cs2f_movement_unlocker_enable", FCVAR_NONE, "Whether to enable movement unlocker", false, +CConVar cs2f_movement_unlocker_enable("cs2f_movement_unlocker_enable", FCVAR_NONE, "Whether to enable movement unlocker, clients will not predict", false, [](CConVar* cvar, CSplitScreenSlot slot, const bool* new_val, const bool* old_val) { // Movement unlocker is always the first patch if (*new_val)