From 4324f923bc44d331eb1037d050b07fae42d5ab2e Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 22 Jul 2022 18:29:29 +1000 Subject: [PATCH] - Call `updateTurnHeldAmt()` after doing the turn, not before it. This gives one tic more preamble. --- source/core/gameinput.cpp | 3 ++- source/games/duke/src/input.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index efaa40dcc..b5fbc0b0f 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -215,7 +215,6 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe if (turnleft || turnright) { - updateTurnHeldAmt(scaleAdjust); double const turnspeed = getTicrateScale(running ? RUNNINGTURNBASE : NORMALTURNBASE) * turnscale * BAngToDegree; float const turnamount = float(scaleAdjust * turnspeed * (isTurboTurnTime() ? 1. : PREAMBLESCALE)); @@ -224,6 +223,8 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe if (turnright) currInput->avel += turnamount; + + updateTurnHeldAmt(scaleAdjust); } else { diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 65e1fd3bb..4d8766252 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -589,7 +589,6 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->dyaw < 0) { - updateTurnHeldAmt(factor); p->TiltStatus -= (float)factor; if (p->TiltStatus < -10) @@ -603,11 +602,12 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool if (hidInput->dyaw < 0) turnvel += (p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * hidInput->dyaw; + + updateTurnHeldAmt(factor); } if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->dyaw > 0) { - updateTurnHeldAmt(factor); p->TiltStatus += (float)factor; if (p->TiltStatus > 10) @@ -621,6 +621,8 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool if (hidInput->dyaw > 0) turnvel += (p->MotoSpeed > 0 ? baseVel : baseVel * velScale) * hidInput->dyaw; + + updateTurnHeldAmt(factor); } } else @@ -660,8 +662,6 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->dyaw < 0) { - updateTurnHeldAmt(factor); - if (!p->NotOnWater) { p->TiltStatus -= (float)factor; @@ -677,12 +677,12 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool if (hidInput->dyaw < 0) turnvel += baseVel * hidInput->dyaw; + + updateTurnHeldAmt(factor); } if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->dyaw > 0) { - updateTurnHeldAmt(factor); - if (!p->NotOnWater) { p->TiltStatus += (float)factor; @@ -698,6 +698,8 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool if (hidInput->dyaw > 0) turnvel += baseVel * hidInput->dyaw; + + updateTurnHeldAmt(factor); } } else if (!p->NotOnWater)