From dcf1c540e6842450606fe4c9dc85bc3d384e236f Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 5 Jun 2022 21:24:50 +1000 Subject: [PATCH] - Another amendment to 18541d1ab422f4a98fb44b9531a3a2627ece1335 and 1ac58dc41cc741554bc332c9b49a25e9a7415564 to ensure input lock is only set when we're running unsynchronised input. --- source/core/gameinput.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 28d1785e1..526b928c2 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -92,13 +92,13 @@ struct PlayerHorizon void settarget(fixedhoriz value, bool const lock = false) { + // Clamp incoming variable because sometimes the caller can exceed bounds. value = q16horiz(clamp(value.asq16(), gi->playerHorizMin(), gi->playerHorizMax())); - inputdisabled = lock; if (!SyncInput()) { - target = value; - if (!targetset()) target = q16horiz(1); + inputdisabled = lock; + target = value.asq16() ? value : q16horiz(1); } else { @@ -210,12 +210,10 @@ struct PlayerAngle void settarget(binangle const value, bool const lock = false) { - inputdisabled = lock; - if (!SyncInput()) { - target = value; - if (!targetset()) target = bamang(1); + inputdisabled = lock; + target = value.asbam() ? value : bamang(1); } else {