Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cfg/cs2fixes/cs2fixes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/detours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> 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();
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CMemPatch g_CommonPatches[] =
CMemPatch("SetSchemaHammerUniqueId", "SetSchemaHammerUniqueId"),
};

CConVar<bool> cs2f_movement_unlocker_enable("cs2f_movement_unlocker_enable", FCVAR_NONE, "Whether to enable movement unlocker", false,
CConVar<bool> cs2f_movement_unlocker_enable("cs2f_movement_unlocker_enable", FCVAR_NONE, "Whether to enable movement unlocker, clients will not predict", false,
[](CConVar<bool>* cvar, CSplitScreenSlot slot, const bool* new_val, const bool* old_val) {
// Movement unlocker is always the first patch
if (*new_val)
Expand Down
Loading