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 683881c7..17d4aef0 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_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) { 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 iAllowDuckSpam = g_cvarAllowDuckSpam.Get(); + + if ((iAllowDuckSpam == 1 || pPawn->m_iTeamNum() == iAllowDuckSpam) && pThis->m_flDuckSpeed() != 8.0f) + pThis->m_flDuckSpeed = 8.0f; + float flSpeedMod = pController->GetZEPlayer()->GetSpeedMod(); if (flSpeedMod == 1.f) 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)