From 7dbd38c84a3d301440a8ffef6500e82fea332601 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 8 Nov 2023 16:45:21 +1100 Subject: [PATCH] Revert "- clamp player sprite's xvel between 0 and 512 to stop it going into the negative with rapid posx/posy changes due to teleporting." This reverts commit cf548e055e8679816a129afa779f523d7a820bad. * Shouldn't be necessary now with doubles instead of integers for coordinates. * Affected spot in commit message appears fine upon testing. --- source/games/duke/src/player_d.cpp | 2 +- source/games/duke/src/player_r.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 0fb3ca3fa..cdad70386 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1676,7 +1676,7 @@ void processinput_d(DDukePlayer* const p) p->playerweaponsway(pact->vel.X); - pact->vel.X = clamp((pact->spr.pos.XY() - p->bobpos).Length(), 0., 32.); + pact->vel.X = (pact->spr.pos.XY() - p->bobpos).Length(); if (p->on_ground) p->bobcounter += int(pact->vel.X * 8); p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floortexture == mirrortex) || !p->insector())); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 43384601d..aa5376c5d 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -2498,7 +2498,7 @@ void processinput_r(DDukePlayer* const p) p->playerweaponsway(pact->vel.X); - pact->vel.X = clamp((pact->spr.pos.XY() - p->bobpos).Length(), 0., 32.); + pact->vel.X = (pact->spr.pos.XY() - p->bobpos).Length(); if (p->on_ground) p->bobcounter += int(pact->vel.X * 8); p->backuppos(ud.clipping == 0 && ((p->insector() && p->cursector->floortexture == mirrortex) || !p->insector()));