- Fixed: Teleports that were not initiated by walking would not trigger sector actions.
SVN r3455 (trunk)
This commit is contained in:
parent
e93029a42a
commit
37a322e46b
3 changed files with 66 additions and 27 deletions
|
|
@ -307,6 +307,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
|
|||
bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag)
|
||||
{
|
||||
FCheckPosition tmf;
|
||||
sector_t *oldsec = thing->Sector;
|
||||
|
||||
// kill anything occupying the position
|
||||
|
||||
|
|
@ -405,6 +406,13 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
|||
thing->PrevY = y;
|
||||
thing->PrevZ = z;
|
||||
|
||||
// If this teleport was caused by a move, P_TryMove() will handle the
|
||||
// sector transition messages better than we can here.
|
||||
if (!(thing->flags6 & MF6_INTRYMOVE))
|
||||
{
|
||||
thing->CheckSectorTransition(oldsec);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1677,6 +1685,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
{
|
||||
thing->z = onfloor->ZatPoint (x, y);
|
||||
}
|
||||
thing->flags6 |= MF6_INTRYMOVE;
|
||||
if (!P_CheckPosition (thing, x, y, tm))
|
||||
{
|
||||
AActor *BlockingMobj = thing->BlockingMobj;
|
||||
|
|
@ -1704,6 +1713,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
if (!(tm.thing->flags2 & MF2_PASSMOBJ) || (i_compatflags & COMPATF_NO_PASSMOBJ))
|
||||
{
|
||||
thing->z = oldz;
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1813,6 +1823,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
{ // Can't move over a dropoff unless it's been blasted
|
||||
// [GZ] Or missile-spawned
|
||||
thing->z = oldz;
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1821,7 +1832,11 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
// special logic to move a monster off a dropoff
|
||||
// this intentionally does not check for standing on things.
|
||||
if (thing->floorz - tm.floorz > thing->MaxDropOffHeight ||
|
||||
thing->dropoffz - tm.dropoffz > thing->MaxDropOffHeight) return false;
|
||||
thing->dropoffz - tm.dropoffz > thing->MaxDropOffHeight)
|
||||
{
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (thing->flags2 & MF2_CANTLEAVEFLOORPIC
|
||||
|
|
@ -1829,6 +1844,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
|| tm.floorz - thing->z != 0))
|
||||
{ // must stay within a sector of a certain floor type
|
||||
thing->z = oldz;
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1843,6 +1859,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
thing->velx = 0;
|
||||
thing->vely = 0;
|
||||
thing->z = oldz;
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1869,7 +1886,10 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
if (thing->BounceFlags & BOUNCE_MBF && // killough 8/13/98
|
||||
!(thing->flags & (MF_MISSILE|MF_NOGRAVITY)) &&
|
||||
!thing->IsSentient() && tm.floorz - thing->z > 16*FRACUNIT)
|
||||
return false; // too big a step up for MBF bouncers under gravity
|
||||
{ // too big a step up for MBF bouncers under gravity
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// the move is ok, so link the thing into its new position
|
||||
thing->UnlinkFromWorld ();
|
||||
|
|
@ -1896,6 +1916,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
// [RH] Don't activate anything if just predicting
|
||||
if (thing->player && (thing->player->cheats & CF_PREDICTING))
|
||||
{
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1967,34 +1988,13 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
}
|
||||
|
||||
// [RH] If changing sectors, trigger transitions
|
||||
if (oldsec != newsec)
|
||||
{
|
||||
if (oldsec->SecActTarget)
|
||||
{
|
||||
oldsec->SecActTarget->TriggerAction (thing, SECSPAC_Exit);
|
||||
}
|
||||
if (newsec->SecActTarget)
|
||||
{
|
||||
int act = SECSPAC_Enter;
|
||||
if (thing->z <= newsec->floorplane.ZatPoint (thing->x, thing->y))
|
||||
{
|
||||
act |= SECSPAC_HitFloor;
|
||||
}
|
||||
if (thing->z + thing->height >= newsec->ceilingplane.ZatPoint (thing->x, thing->y))
|
||||
{
|
||||
act |= SECSPAC_HitCeiling;
|
||||
}
|
||||
if (newsec->heightsec &&
|
||||
thing->z == newsec->heightsec->floorplane.ZatPoint (thing->x, thing->y))
|
||||
{
|
||||
act |= SECSPAC_HitFakeFloor;
|
||||
}
|
||||
newsec->SecActTarget->TriggerAction (thing, act);
|
||||
}
|
||||
}
|
||||
thing->CheckSectorTransition(oldsec);
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
return true;
|
||||
|
||||
pushline:
|
||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||
|
||||
// [RH] Don't activate anything if just predicting
|
||||
if (thing->player && (thing->player->cheats & CF_PREDICTING))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue