From 74a04474e124f30a7a02721f2371ff9c39c0630b Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Tue, 4 Feb 2025 22:10:16 +0800 Subject: [PATCH] Smoothly interpolate the player pitch-centering action --- wadsrc/static/zscript/actors/player/player.zs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index b320b6253..6bfb58344 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -1401,15 +1401,17 @@ class PlayerPawn : Actor { if (abs(Pitch) > 2.) { - Pitch *= (2. / 3.); + A_SetPitch(Pitch * (2. / 3.), SPF_INTERPOLATE); } else { - Pitch = 0.; - player.centering = false; - if (PlayerNumber() == consoleplayer) + A_SetPitch(Pitch * 0.75, SPF_INTERPOLATE); + if (abs(Pitch) <= 0.25) { - LocalViewPitch = 0; + A_SetPitch(0., SPF_INTERPOLATE); + player.centering = false; + if (PlayerNumber() == consoleplayer) + LocalViewPitch = 0; } } }