Proper fix for erratic ViewPitch.

This commit is contained in:
Mari the Deer 2023-02-11 19:13:29 +01:00
commit feead68093
2 changed files with 5 additions and 4 deletions

View file

@ -449,10 +449,11 @@ extend Class Demolitionist
bumproll *= .8;
}
// stabilize view angles
temp *= .8;
if ( temp dot temp < double.epsilon ) temp = (0,0,0);
else temp *= .8;
if ( ViewAngle != temp.x ) A_SetViewAngle(temp.x,SPF_INTERPOLATE);
if ( ViewPitch != temp.y ) A_SetViewPitch(temp.y,SPF_INTERPOLATE);
// IMPORTANT: don't call A_SetViewPitch if the player's min/max pitch are not yet initialized
if ( (ViewPitch != temp.y) && (player.MinPitch == player.MaxPitch == pitch) ) A_SetViewPitch(temp.y,SPF_INTERPOLATE);
if ( ViewRoll != temp.z ) A_SetViewRoll(temp.z,SPF_INTERPOLATE);
if ( player.onground && !lastground ) landvelz = lastvelz;
else if ( !player.onground && lastground ) landvelz = 0;