diff --git a/source/sw/src/game.h b/source/sw/src/game.h index cbbecfaed..6e9b815e4 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -188,6 +188,8 @@ int krand1(void); #include "pragmas.h" +extern SWBOOL PedanticMode; +extern SWBOOL InterpolateSectObj; // // Map directions/degrees @@ -453,6 +455,11 @@ static fix16_t FORCE_INLINE GetQ16AngleFromVect(int32_t xvect, int32_t yvect) return (PedanticMode ? getq16angle : gethiq16angle)(xvect, yvect); } +static fix16_t FORCE_INLINE PedanticQ16AngleFloor(fix16_t ang) +{ + return PedanticMode ? fix16_floor(ang) : ang; +} + int StdRandomRange(int range); #define STD_RANDOM_P2(pwr_of_2) (MOD_P2(rand(),(pwr_of_2))) #define STD_RANDOM_RANGE(range) (StdRandomRange(range)) @@ -889,9 +896,6 @@ extern int PlayerYellVocs[MAX_YELLSOUNDS]; void BossHealthMeter(void); -extern SWBOOL PedanticMode; -extern SWBOOL InterpolateSectObj; - // Global variables used for modifying variouse things from the Console /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index ab627bb50..aac32f886 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1626,9 +1626,7 @@ DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel) q16angvel += fix16_sdiv(q16angvel, fix16_from_int(4)); *pq16ang += fix16_sdiv(fix16_mul(q16angvel, fix16_from_int(synctics)), fix16_from_int(32)); - *pq16ang = NORM_Q16ANGLE(*pq16ang); - if (PedanticMode) - *pq16ang = fix16_floor(*pq16ang); + *pq16ang = PedanticQ16AngleFloor(NORM_Q16ANGLE(*pq16ang)); // update players sprite angle // NOTE: It's also updated in UpdatePlayerSprite, but needs to be