From b3943a0c04e9622e6e9bbbd1bdea0446151dd9ae Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 8 Oct 2022 11:41:08 +1100 Subject: [PATCH] - Duke: Maintain x/y/z velocity when falling through a portal, such as E1L1's air duct. --- source/games/duke/src/actors_d.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 57a92b6d5..4525ab597 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -1816,14 +1816,10 @@ void movetransports_d(void) if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) || (ps[p].jetpack_on && PlayerInput(p, SB_CROUCH))) { - ps[p].pos.X += Owner->spr.pos.X - act->spr.pos.X; - ps[p].pos.Y += Owner->spr.pos.Y - act->spr.pos.Y; - ps[p].backupxy(); - - if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11)) - ps[p].pos.Z = Owner->spr.pos.Z - 24; - else ps[p].pos.Z = Owner->spr.pos.Z + 24; - ps[p].backupz(); + ps[p].opos -= ps[p].pos; + ps[p].pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY(); + ps[p].pos.Z = Owner->spr.pos.Z - (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11) ? 24 : -24); + ps[p].opos += ps[p].pos; auto pa = ps[p].GetActor(); pa->opos = ps[p].pos;