Commit 1a90b988 authored by Mitchell Richters's avatar Mitchell Richters Committed by Richard Gobeille
Browse files

- Duke3D: Ensure player maintains velocity when going through a portal.

* The current setup that's been long-standing has the player come to a complete stand-still for one tic while transiting through a portal.
* By saving off the velocity difference between the player's pos/opos, we can re-apply that to opos to make the portal transition truly seamless.
parent 122aee01
......@@ -3974,6 +3974,8 @@ ACTOR_STATIC void G_MoveTransports(void)
if (!pPlayer->jetpack_on || TEST_SYNC_KEY(thisPlayer.input.bits, SK_JUMP)
|| TEST_SYNC_KEY(thisPlayer.input.bits, SK_CROUCH))
{
auto posdiff = pPlayer->opos - pPlayer->pos;
pPlayer->pos.x += sprite[OW(spriteNum)].x - SX(spriteNum);
pPlayer->pos.y += sprite[OW(spriteNum)].y - SY(spriteNum);
pPlayer->pos.z = (pPlayer->jetpack_on && (TEST_SYNC_KEY(thisPlayer.input.bits, SK_JUMP)
......@@ -3982,7 +3984,7 @@ ACTOR_STATIC void G_MoveTransports(void)
: sprite[OW(spriteNum)].z + 6144;
actor[pPlayer->i].bpos = pPlayer->pos;
pPlayer->opos = pPlayer->pos;
pPlayer->opos = pPlayer->pos + posdiff;
pPlayer->bobpos = pPlayer->pos.xy;
changespritesect(sectSprite, sprite[OW(spriteNum)].sectnum);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment