diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 894b35fe2..78d6cee4c 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -57,8 +57,6 @@ struct PlayerHorizon bool targetset() { return target.asq16(); } // Input locking helpers. - void lockinput() { inputdisabled = true; } - void unlockinput() { inputdisabled = false; } bool movementlocked() { return targetset() || inputdisabled; } // Draw code helpers. @@ -92,9 +90,10 @@ struct PlayerHorizon } } - void settarget(fixedhoriz value) + void settarget(fixedhoriz value, bool const lock = false) { value = q16horiz(clamp(value.asq16(), gi->playerHorizMin(), gi->playerHorizMax())); + inputdisabled = lock; if (!SyncInput()) { diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 932db29a0..58546d8d9 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -2234,8 +2234,7 @@ void trPlayerCtrlSetLookAngle(int value, PLAYER* pPlayer) adjustment = 0; } - pPlayer->horizon.settarget(buildfhoriz(100. * tan(adjustment * pi::pi() / 1024.))); - pPlayer->horizon.lockinput(); + pPlayer->horizon.settarget(buildfhoriz(100. * tan(adjustment * pi::pi() / 1024.)), true); } //--------------------------------------------------------------------------- diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index d9b3e712e..2e070d2f1 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1781,9 +1781,6 @@ void ProcessInput(PLAYER* pPlayer) doslopetilting(pPlayer); } - pPlayer->angle.unlockinput(); - pPlayer->horizon.unlockinput(); - pPlayer->slope = -pPlayer->horizon.horiz.asq16() >> 9; if (pInput->actions & SB_INVPREV) {