diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 5a72a6fa9..522fec5dd 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -3283,11 +3283,12 @@ getinput(SW_PACKET *loc, SWBOOL tied) q16angvel = fix16_floor(q16angvel); q16aimvel = fix16_floor(q16aimvel); } - else if (!TEST(pp->Flags, PF_DEAD) && (pp->DoPlayerAction != DoPlayerTeleportPause)) + else { - if (!TEST(pp->Flags, PF_CLIMBING) && !pp->sop_control) + if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN)) DoPlayerTurn(pp, &pp->camq16ang, q16angvel); - DoPlayerHorizon(pp, &pp->camq16horiz, q16aimvel); + if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM)) + DoPlayerHorizon(pp, &pp->camq16horiz, q16aimvel); } loc->vel += vel; diff --git a/source/sw/src/game.h b/source/sw/src/game.h index f299112e2..083a30b9f 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -1357,6 +1357,8 @@ extern PLAYER Player[MAX_SW_PLAYERS_REG+1]; #define PF_WEAPON_DOWN (BIT(31)) #define PF2_TELEPORTED (BIT(0)) +#define PF2_INPUT_CAN_TURN (BIT(1)) // Allow calling DoPlayerTurn from getinput +#define PF2_INPUT_CAN_AIM (BIT(2)) // Allow calling DoPlayerHorizon from getinput /////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index b9d99b1fb..b27035b15 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1545,6 +1545,7 @@ DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel) if (!PedanticMode && (pq16ang == &pp->q16ang)) { + SET(pp->Flags2, PF2_INPUT_CAN_TURN); pp->q16ang = pp->oq16ang = pp->input.q16ang; sprite[pp->PlayerSprite].ang = fix16_to_int(*pq16ang); if (!Prediction) @@ -1914,6 +1915,7 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel) if (!PedanticMode && (pq16horiz == &pp->q16horiz)) { + SET(pp->Flags2, PF2_INPUT_CAN_AIM); pp->q16horiz = pp->oq16horiz = pp->input.q16horiz; return; } @@ -6779,6 +6781,9 @@ void DoPlayerDeathFollowKiller(PLAYERp pp) //DoPlayerDeathTilt(pp, pp->tilt_dest, 4 * synctics); // allow turning + if (TEST(pp->Flags, PF_DEAD_HEAD|PF_HEAD_CONTROL)) + SET(pp->Flags2, PF2_INPUT_CAN_TURN); + if ((TEST(pp->Flags, PF_DEAD_HEAD) && pp->input.q16angvel != 0) || TEST(pp->Flags, PF_HEAD_CONTROL)) { DoPlayerTurn(pp, &pp->q16ang, pp->input.q16angvel); @@ -8021,6 +8026,8 @@ domovethings(void) DoPlayerSectorUpdatePreMove(pp); ChopsCheck(pp); + // Reset flags used while tying input to framerate + RESET(pp->Flags2, PF2_INPUT_CAN_TURN|PF2_INPUT_CAN_AIM); // extern SWBOOL ScrollMode2D; //if (!ScrollMode2D) if (pp->DoPlayerAction) pp->DoPlayerAction(pp);