Skip to content

Commit

Permalink
Revert "Allow getting max pre from crouched positions"
Browse files Browse the repository at this point in the history
This reverts commit b9add9a.
  • Loading branch information
zer0k-z committed Nov 20, 2024
1 parent c08498f commit 2abfbec
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/kz/mode/kz_mode_ckz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
{
Expand Down

0 comments on commit 2abfbec

Please sign in to comment.