From 94e198f9a9ed2f95c555f9c222eb7b0efaa5671e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 30 Aug 2022 21:20:45 +0200 Subject: [PATCH] - SW: floatified DoPlayerTeleportToSprite --- source/games/sw/src/player.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 01d977b39..b9e690bf3 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1269,22 +1269,13 @@ void DoPlayerTeleportPause(PLAYER* pp) } } -void DoPlayerTeleportToSprite(PLAYER* pp, vec3_t* pos, int ang) +void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang) { - pp->angle.ang = pp->angle.oang = DAngle::fromBuild(ang); - pp->set_int_ppos_XY(pos->XY()); + pp->angle.ang = pp->angle.oang = ang; + pp->opos = pp->pos= pos.plusZ(-PLAYER_HEIGHTF); + pp->oldpos.XY() = pp->pos.XY(); - pp->oldpos.XY() = pp->opos.XY() = pp->pos.XY(); - - - //getzsofslopeptr(actor->s - // ector(), pp->posx, pp->posy, &cz, &fz); - //pp->posz = pp->oposz = fz - PLAYER_HEIGHT; - - pp->set_int_ppos_Z(pos->Z - PLAYER_HEIGHT); - pp->opos.Z = pp->pos.Z; - - updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector); + updatesector(pp->pos, &pp->cursector); pp->Flags2 |= (PF2_TELEPORTED); } @@ -1365,9 +1356,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp) break; default: { - auto pos = act_warp->int_pos(); - DoPlayerTeleportToSprite(pp, &pos, act_warp->int_ang()); - act_warp->set_int_pos(pos); + DoPlayerTeleportToSprite(pp, act_warp->spr.pos, act_warp->spr.angle); PlaySound(DIGI_TELEPORT, pp, v3df_none);