- actor transition through a sector portal is working.
This commit is contained in:
parent
58839200e5
commit
01bdd8a7da
3 changed files with 66 additions and 2 deletions
|
|
@ -3288,6 +3288,43 @@ void AActor::SetRoll(angle_t r, bool interpolate)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void AActor::CheckPortalTransition()
|
||||
{
|
||||
if (!Sector->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
AActor *port = Sector->SkyBoxes[sector_t::ceiling];
|
||||
if (Z() > port->threshold)
|
||||
{
|
||||
fixedvec3 oldpos = Pos();
|
||||
UnlinkFromWorld();
|
||||
SetXYZ(PosRelative(port->Sector));
|
||||
PrevX += X() - oldpos.x;
|
||||
PrevY += Y() - oldpos.y;
|
||||
PrevZ += Z() - oldpos.z;
|
||||
LinkToWorld();
|
||||
if (player) Printf("Transitioned upwards to sector %d\n", Sector->sectornum);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!Sector->PortalBlocksMovement(sector_t::floor))
|
||||
{
|
||||
AActor *port = Sector->SkyBoxes[sector_t::floor];
|
||||
if (Z() < port->threshold && floorz < port->threshold)
|
||||
{
|
||||
fixedvec3 oldpos = Pos();
|
||||
UnlinkFromWorld();
|
||||
SetXYZ(PosRelative(port->Sector));
|
||||
PrevX += X() - oldpos.x;
|
||||
PrevY += Y() - oldpos.y;
|
||||
PrevZ += Z() - oldpos.z;
|
||||
LinkToWorld();
|
||||
if (player) Printf("Transitioned downwards to sector %d\n", Sector->sectornum);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_MobjThinker
|
||||
//
|
||||
|
|
@ -3355,6 +3392,7 @@ void AActor::Tick ()
|
|||
UnlinkFromWorld ();
|
||||
flags |= MF_NOBLOCKMAP;
|
||||
SetXYZ(Vec3Offset(velx, vely, velz));
|
||||
CheckPortalTransition();
|
||||
SetMovement(velx, vely, velz);
|
||||
LinkToWorld ();
|
||||
}
|
||||
|
|
@ -3822,6 +3860,8 @@ void AActor::Tick ()
|
|||
Crash();
|
||||
}
|
||||
|
||||
CheckPortalTransition();
|
||||
|
||||
UpdateWaterLevel (oldz);
|
||||
|
||||
// [RH] Don't advance if predicting a player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue