diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 5e7adea90..2b714a81c 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -230,7 +230,7 @@ void PlayerColorChanged(void); void nonsharedkeys(void); void apply_seasick(player_struct* p, double scalefactor); void calcviewpitch(player_struct* p, double factor); -void sethorizon(int snum, int sb_snum, double factor, bool frominput, fixed_t adjustment); +void sethorizon(int snum, int sb_snum, double factor, fixed_t adjustment); bool movementBlocked(int snum); void GetInput(); void startmainmenu(); diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 094144a8d..8a5ed93ca 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -1260,7 +1260,7 @@ void GetInput() // Do these in the same order as the old code. calcviewpitch(p, scaleAdjust); applylook(myconnectindex, scaleAdjust, input.q16avel); - sethorizon(myconnectindex, loc.bits, scaleAdjust, true, input.q16horz); + sethorizon(myconnectindex, loc.bits, scaleAdjust, input.q16horz); } } diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index e3a198646..a95a41431 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -991,7 +991,7 @@ void checklook(int snum, int sb_snum) // //--------------------------------------------------------------------------- -void sethorizon(int snum, int sb_snum, double factor, bool frominput, fixed_t adjustment) +void sethorizon(int snum, int sb_snum, double factor, fixed_t adjustment) { auto p = &ps[snum]; @@ -1000,20 +1000,14 @@ void sethorizon(int snum, int sb_snum, double factor, bool frominput, fixed_t ad if (p->return_to_center > 0 && (sb_snum & (SKB_LOOK_UP | SKB_LOOK_DOWN)) == 0) // only snap back if no relevant button is pressed. { - p->return_to_center -= factor * 1.; - horizAngle += factor * -(frominput? 1.1 : 0.55) * horizAngle; // in P_GetInput this used different factors than in the original code. Hm... + p->return_to_center += -factor * (p->return_to_center / 2); + horizAngle += -factor * (horizAngle / 2); - if (horizAngle > -1. && horizAngle < 1.) + if (horizAngle > -0.5 && horizAngle < 0.5) { horizAngle = 0.; p->return_to_center = 0.; } - - if (p->aim_mode == 0) - { - // threshold was 5 - if (p->q16horizoff > F16(-1) && p->q16horizoff < F16(1)) p->sethorizoff(0); - } } // Convert back to Build's horizon.