Backend update from Raze.

This commit is contained in:
Christoph Oelckers 2023-10-07 18:42:24 +02:00
commit 89535b803a
74 changed files with 506 additions and 402 deletions

View file

@ -1879,7 +1879,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
{
mo->Vel.MakeResize(VELOCITY_THRESHOLD);
}
move = mo->Vel;
move = mo->Vel.XY();
// [RH] Carrying sectors didn't work with low speeds in BOOM. This is
// because BOOM relied on the speed being fast enough to accumulate
// despite friction. If the speed is too low, then its movement will get
@ -1965,7 +1965,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
// because it also calls P_CheckSlopeWalk on its clipped steps.
DVector2 onestep = startmove / steps;
start = mo->Pos();
start = mo->Pos().XY();
step = 1;
totalsteps = steps;
@ -1990,7 +1990,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
ptry = start + move * step / steps;
DVector2 startvel = mo->Vel;
DVector2 startvel = mo->Vel.XY();
// killough 3/15/98: Allow objects to drop off
// [RH] If walking on a slope, stay on the slope
@ -2044,7 +2044,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
// If the move is done a second time (because it was too fast for one move), it
// is still clipped against the wall at its full speed, so you effectively
// execute two moves in one tic.
P_SlideMove (mo, mo->Vel, 1);
P_SlideMove (mo, mo->Vel.XY(), 1);
}
else
{
@ -2058,7 +2058,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
{
if (!player || !(mo->Level->i_compatflags & COMPATF_WALLRUN))
{
move = mo->Vel;
move = mo->Vel.XY();
onestep = move / steps;
P_CheckSlopeWalk (mo, move);
}
@ -2075,7 +2075,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
DVector2 t;
t.X = 0, t.Y = onestep.Y;
walkplane = P_CheckSlopeWalk (mo, t);
if (P_TryMove (mo, mo->Pos() + t, true, walkplane, tm))
if (P_TryMove (mo, mo->Pos().XY() + t, true, walkplane, tm))
{
mo->Vel.X = 0;
}
@ -2083,7 +2083,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
{
t.X = onestep.X, t.Y = 0;
walkplane = P_CheckSlopeWalk (mo, t);
if (P_TryMove (mo, mo->Pos() + t, true, walkplane, tm))
if (P_TryMove (mo, mo->Pos().XY() + t, true, walkplane, tm))
{
mo->Vel.Y = 0;
}
@ -2194,7 +2194,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
move = move.Rotated(anglediff);
oldangle = mo->Angles.Yaw;
}
start = mo->Pos() - move * step / steps;
start = mo->Pos().XY() - move * step / steps;
}
}
}
@ -2877,7 +2877,7 @@ void P_NightmareRespawn (AActor *mobj)
}
// something is occupying its position?
if (!P_CheckPosition(mo, mo->Pos(), true))
if (!P_CheckPosition(mo, mo->Pos().XY(), true))
{
//[GrafZahl] MF_COUNTKILL still needs to be checked here.
mo->ClearCounters();
@ -2906,7 +2906,7 @@ void P_NightmareRespawn (AActor *mobj)
P_SpawnTeleportFog(mobj, mobj->Pos(), true, true);
// spawn a teleport fog at the new spot
P_SpawnTeleportFog(mobj, DVector3(mobj->SpawnPoint, z), false, true);
P_SpawnTeleportFog(mobj, DVector3(mobj->SpawnPoint.XY(), z), false, true);
// remove the old monster
mobj->Destroy ();
@ -5728,7 +5728,7 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
else
sz = ONFLOORZ;
mobj = AActor::StaticSpawn (this, i, DVector3(mthing->pos, sz), NO_REPLACE, true);
mobj = AActor::StaticSpawn (this, i, DVector3(mthing->pos.XY(), sz), NO_REPLACE, true);
if (sz == ONFLOORZ)
{
@ -6538,7 +6538,7 @@ bool P_CheckMissileSpawn (AActor* th, double maxdist)
// killough 3/15/98: no dropoff (really = don't care for missiles)
auto oldf2 = th->flags2;
th->flags2 &= ~(MF2_MCROSS|MF2_PCROSS); // The following check is not supposed to activate missile triggers.
if (!(P_TryMove (th, newpos, false, NULL, tm, true)))
if (!(P_TryMove (th, newpos.XY(), false, NULL, tm, true)))
{
// [RH] Don't explode ripping missiles that spawn inside something
if (th->BlockingMobj == NULL || !(th->flags2 & MF2_RIP) || (th->BlockingMobj->flags5 & MF5_DONTRIP))
@ -7576,7 +7576,7 @@ static FRandom pr_restore("RestorePos");
void AActor::RestoreSpecialPosition()
{
// Move item back to its original location
DVector2 sp = SpawnPoint;
DVector2 sp = SpawnPoint.XY();
FLinkContext ctx;
UnlinkFromWorld(&ctx);