From ebd8ab985e495a9a47952f7a004897176729135f Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 19 Mar 2023 21:39:52 +1100 Subject: [PATCH] - Duke/RR: Don't archive off MotoSpeed for reuse at end of vehicle functions. * Kept the workflow identical to the old setup in the other commits, but does not seem necessary and all it does is make the speed one tic behind where it would be otherwise. --- source/games/duke/src/player_r.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 45a88d1fe..f97d888f0 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1473,7 +1473,6 @@ static void onMotorcycle(int snum, ESyncBits &actions) if (p->moto_underwater) p->MotoSpeed = 0; - const auto oldMotoSpeed = clamp((float)p->MotoSpeed, -15.f, 120.f) * (1.f / 40.f); bool forward = p->sync.fvel > 0; bool reverse = p->sync.fvel < 0; bool turnLeft = p->sync.avel < 0; @@ -1705,7 +1704,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) } p->moto_on_mud = p->moto_on_oil = 0; - p->sync.fvel = oldMotoSpeed; + p->sync.fvel = clamp((float)p->MotoSpeed, -15.f, 120.f) * (1.f / 40.f); } //--------------------------------------------------------------------------- @@ -1722,7 +1721,6 @@ static void onBoat(int snum, ESyncBits &actions) bool braking = false, heeltoe = false; int rng; - const auto oldMotoSpeed = clamp((float)p->MotoSpeed, -15.f, 120.f) * (1.f / 40.f); bool forward = p->sync.fvel > 0; bool reverse = p->sync.fvel < 0; bool turnLeft = p->sync.avel < 0; @@ -1949,7 +1947,7 @@ static void onBoat(int snum, ESyncBits &actions) if (p->NotOnWater && p->MotoSpeed > 50) p->MotoSpeed -= (p->MotoSpeed / 2.); - p->sync.fvel = oldMotoSpeed; + p->sync.fvel = clamp((float)p->MotoSpeed, -15.f, 120.f) * (1.f / 40.f); } //---------------------------------------------------------------------------