From feead68093dc2cec6e5089e3ce12a1e9f8ef5613 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sat, 11 Feb 2023 19:13:29 +0100 Subject: [PATCH] Proper fix for erratic ViewPitch. --- language.version | 4 ++-- zscript/player/swwm_player_tick.zsc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/language.version b/language.version index 265b3b2cc..cc3dd90d5 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r746 \cu(Sat 11 Feb 19:17:38 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r746 \cu(2023-02-11 19:17:38)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r747 \cu(Sat 11 Feb 19:17:47 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r747 \cu(2023-02-11 19:17:47)\c-"; diff --git a/zscript/player/swwm_player_tick.zsc b/zscript/player/swwm_player_tick.zsc index 065f03184..9473db714 100644 --- a/zscript/player/swwm_player_tick.zsc +++ b/zscript/player/swwm_player_tick.zsc @@ -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;