diff --git a/source/core/coreplayer.h b/source/core/coreplayer.h index d15fc7431..387000f29 100644 --- a/source/core/coreplayer.h +++ b/source/core/coreplayer.h @@ -32,3 +32,8 @@ public: }; extern DCorePlayer* PlayerArray[MAXPLAYERS]; + +inline ESyncBits GetPersistentActions() +{ + return PlayerArray[myconnectindex]->cmd.ucmd.actions & SB_CENTERVIEW; +} diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 15ccb5ebf..036c2f368 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -272,7 +272,7 @@ void GameInput::processInputBits() else dpad_lock = 0; const auto crouchState = gi->getCrouchState(); - inputBuffer.actions |= ActionsToSend | (PlayerArray[myconnectindex]->cmd.ucmd.actions & SB_CENTERVIEW); + inputBuffer.actions |= ActionsToSend | GetPersistentActions(); ActionsToSend = 0; if (buttonMap.ButtonDown(gamefunc_Aim_Up) || (buttonMap.ButtonDown(gamefunc_Dpad_Aiming) && joyAxes[JOYAXIS_Forward] > 0)) diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 287b453cf..41d36c33a 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -275,6 +275,7 @@ static void GameTicker() Net_ClearFifo(); inputState.ClearAllInput(); gameInput.Clear(); + gameInput.SendAction(GetPersistentActions()); gamestate = GS_LEVEL; return;