diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 551f60f3d..b11e845fa 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -181,33 +181,33 @@ void PlayerAngles::applyPitch(float const horz, ESyncBits* actions, double const // Process mouse input. if (horz) { - ZzHORIZON() += DAngle::fromDeg(horz); + pActor->spr.Angles.Pitch += DAngle::fromDeg(horz); *actions &= ~SB_CENTERVIEW; } // Process keyboard input. if (auto aiming = !!(*actions & SB_AIM_DOWN) - !!(*actions & SB_AIM_UP)) { - ZzHORIZON() += getTicrateScale(PITCH_AIMSPEED) * scaleAdjust * aiming; + pActor->spr.Angles.Pitch += getTicrateScale(PITCH_AIMSPEED) * scaleAdjust * aiming; *actions &= ~SB_CENTERVIEW; } if (auto looking = !!(*actions & SB_LOOK_DOWN) - !!(*actions & SB_LOOK_UP)) { - ZzHORIZON() += getTicrateScale(PITCH_LOOKSPEED) * scaleAdjust * looking; + pActor->spr.Angles.Pitch += getTicrateScale(PITCH_LOOKSPEED) * scaleAdjust * looking; *actions |= SB_CENTERVIEW; } // Do return to centre. if ((*actions & SB_CENTERVIEW) && !(*actions & (SB_LOOK_UP|SB_LOOK_DOWN))) { - const auto pitch = abs(ZzHORIZON()); + const auto pitch = abs(pActor->spr.Angles.Pitch); const auto scale = pitch > PITCH_CNTRSINEOFFSET ? (pitch - PITCH_CNTRSINEOFFSET).Cos() : 1.; - scaletozero(ZzHORIZON(), PITCH_CENTERSPEED * scale, scaleAdjust); - if (!ZzHORIZON().Sgn()) *actions &= ~SB_CENTERVIEW; + scaletozero(pActor->spr.Angles.Pitch, PITCH_CENTERSPEED * scale, scaleAdjust); + if (!pActor->spr.Angles.Pitch.Sgn()) *actions &= ~SB_CENTERVIEW; } // clamp before we finish, even if it's clamped in the drawer. - ZzHORIZON() = ClampViewPitch(ZzHORIZON()); + pActor->spr.Angles.Pitch = ClampViewPitch(pActor->spr.Angles.Pitch); } else { @@ -238,7 +238,7 @@ void PlayerAngles::applyYaw(float const avel, ESyncBits* actions, double const s if (!lockedYaw()) { // add player's input - ZzANGLE() += DAngle::fromDeg(avel); + pActor->spr.Angles.Yaw += DAngle::fromDeg(avel); if (*actions & SB_TURNAROUND) { @@ -261,7 +261,7 @@ void PlayerAngles::applyYaw(float const avel, ESyncBits* actions, double const s add -= YawSpin; YawSpin = nullAngle; } - ZzANGLE() += add; + pActor->spr.Angles.Yaw += add; } } else