From 2abfbeca53fef2d24a43a488fcb42d6ee463517e Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Wed, 20 Nov 2024 12:35:06 +0100 Subject: [PATCH] Revert "Allow getting max pre from crouched positions" This reverts commit b9add9a5695e1c920d569c478ddf97f385a3b025. --- src/kz/mode/kz_mode_ckz.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/kz/mode/kz_mode_ckz.cpp b/src/kz/mode/kz_mode_ckz.cpp index eb95fa82..f1614a30 100644 --- a/src/kz/mode/kz_mode_ckz.cpp +++ b/src/kz/mode/kz_mode_ckz.cpp @@ -539,9 +539,8 @@ void KZClassicModeService::CalcPrestrafe() punishRate = g_pKZUtils->GetGlobals()->frametime * PS_DECREMENT_RATIO; } - if (this->player->GetPlayerPawn()->m_fFlags & FL_ONGROUND && this->player->oldWalkMoved) + if (this->player->GetPlayerPawn()->m_fFlags & FL_ONGROUND) { -#ifdef NO_CROUCH_PRE // Prevent instant full pre from crouched prestrafe. Vector velocity; this->player->GetVelocity(&velocity); @@ -555,18 +554,15 @@ void KZClassicModeService::CalcPrestrafe() { currentPreRatio = pow(this->bonusSpeed / PS_SPEED_MAX * SPEED_NORMAL / velocity.Length2D(), 1 / PS_RATIO_TO_SPEED) * PS_MAX_PS_TIME; } + this->leftPreRatio = MIN(this->leftPreRatio, currentPreRatio); this->rightPreRatio = MIN(this->rightPreRatio, currentPreRatio); -#endif - this->leftPreRatio += averageRate > PS_MIN_REWARD_RATE ? rewardRate : -punishRate; this->rightPreRatio += averageRate < -PS_MIN_REWARD_RATE ? rewardRate : -punishRate; this->leftPreRatio = Clamp(leftPreRatio, 0.0f, PS_MAX_PS_TIME); this->rightPreRatio = Clamp(rightPreRatio, 0.0f, PS_MAX_PS_TIME); -#ifdef NO_CROUCH_PRE this->bonusSpeed = this->GetPrestrafeGain() / SPEED_NORMAL * velocity.Length2D(); -#endif } else {