mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- Factor in view pitch when clamping player's actor pitch.
This commit is contained in:
parent
991ef5c27f
commit
30de9c1922
1 changed files with 4 additions and 2 deletions
|
@ -190,8 +190,10 @@ void PlayerAngles::doPitchKeys(ESyncBits* actions, const bool stopcentering)
|
|||
if (!pActor->spr.Angles.Pitch.Sgn()) *actions &= ~SB_CENTERVIEW;
|
||||
}
|
||||
|
||||
// clamp before we finish, even if it's clamped in the drawer.
|
||||
pActor->spr.Angles.Pitch = ClampViewPitch(pActor->spr.Angles.Pitch);
|
||||
// clamp before we finish, factoring in the player's view pitch offset.
|
||||
const auto maximum = GetMaxPitch() - ViewAngles.Pitch * (ViewAngles.Pitch < nullAngle);
|
||||
const auto minimum = GetMinPitch() - ViewAngles.Pitch * (ViewAngles.Pitch > nullAngle);
|
||||
pActor->spr.Angles.Pitch = clamp(pActor->spr.Angles.Pitch, maximum, minimum);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue