mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-18 01:42:01 +00:00
- SW: Remove last PLAYER::posSet()
calls.
This commit is contained in:
parent
bf0f0345b3
commit
7eba7aacbd
4 changed files with 7 additions and 21 deletions
|
@ -1891,10 +1891,6 @@ struct PLAYER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void posSet(const DVector3& val)
|
|
||||||
{
|
|
||||||
actor->spr.pos = val.plusZ(-actor->viewzoffset);
|
|
||||||
}
|
|
||||||
void posAdd(const DVector2& val)
|
void posAdd(const DVector2& val)
|
||||||
{
|
{
|
||||||
actor->spr.pos += val;
|
actor->spr.pos += val;
|
||||||
|
|
|
@ -20,7 +20,7 @@ int32_t CONFIG_ReadSetup(void);
|
||||||
|
|
||||||
bool WarpSectorInfo(sectortype* sect, DSWActor** sp_warp);
|
bool WarpSectorInfo(sectortype* sect, DSWActor** sp_warp);
|
||||||
DSWActor* Warp(DVector3& pos, sectortype** sect);
|
DSWActor* Warp(DVector3& pos, sectortype** sect);
|
||||||
DSWActor* WarpPlane(DVector3& pos, sectortype** sect);
|
DSWActor* WarpPlane(DVector3& pos, sectortype** sect, double testz = DBL_MAX);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1402,11 +1402,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp)
|
||||||
TAG 5 to 8 = random match locations
|
TAG 5 to 8 = random match locations
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto pos = pp->posGet();
|
if ((act_warp = Warp(ppActor->spr.pos, &pp->cursector)) == nullptr)
|
||||||
act_warp = Warp(pos, &pp->cursector);
|
|
||||||
pp->posSet(pos);
|
|
||||||
|
|
||||||
if (act_warp == nullptr)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2197,11 +2193,7 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for warp - probably can remove from CeilingHit
|
// check for warp - probably can remove from CeilingHit
|
||||||
auto pos = pp->posGet();
|
if (WarpPlane(actor->spr.pos, &pp->cursector, actor->getOffsetZ()))
|
||||||
auto res = WarpPlane(pos, &pp->cursector);
|
|
||||||
pp->posSet(pos);
|
|
||||||
|
|
||||||
if (res)
|
|
||||||
{
|
{
|
||||||
PlayerWarpUpdatePos(pp);
|
PlayerWarpUpdatePos(pp);
|
||||||
}
|
}
|
||||||
|
@ -3405,11 +3397,7 @@ void DoPlayerClimb(PLAYER* pp)
|
||||||
LadderUpdate = true;
|
LadderUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pos = pp->posGet();
|
if (WarpPlane(pp->actor->spr.pos, &pp->cursector, pp->actor->getOffsetZ()))
|
||||||
auto res = WarpPlane(pos, &pp->cursector);
|
|
||||||
pp->posSet(pos);
|
|
||||||
|
|
||||||
if (res)
|
|
||||||
{
|
{
|
||||||
PlayerWarpUpdatePos(pp);
|
PlayerWarpUpdatePos(pp);
|
||||||
LadderUpdate = true;
|
LadderUpdate = true;
|
||||||
|
|
|
@ -81,10 +81,12 @@ bool WarpPlaneSectorInfo(sectortype* sect, DSWActor** sp_ceiling, DSWActor** sp_
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
DSWActor* WarpPlane(DVector3& pos, sectortype** sect)
|
DSWActor* WarpPlane(DVector3& pos, sectortype** sect, double testz)
|
||||||
{
|
{
|
||||||
DSWActor* sp_floor,* sp_ceiling;
|
DSWActor* sp_floor,* sp_ceiling;
|
||||||
|
|
||||||
|
if (testz == DBL_MAX) testz = pos.Z;
|
||||||
|
|
||||||
if (Prediction)
|
if (Prediction)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue