- Fixed: Teleports that were not initiated by walking would not trigger sector actions.

SVN r3455 (trunk)
This commit is contained in:
Randy Heit 2012-03-18 03:52:18 +00:00
commit 37a322e46b
3 changed files with 66 additions and 27 deletions

View file

@ -3362,6 +3362,42 @@ void AActor::Tick ()
}
}
//==========================================================================
//
// AActor :: CheckSectorTransition
//
// Fire off some sector triggers if the actor has changed sectors.
//
//==========================================================================
void AActor::CheckSectorTransition(sector_t *oldsec)
{
if (oldsec != Sector)
{
if (oldsec->SecActTarget != NULL)
{
oldsec->SecActTarget->TriggerAction(this, SECSPAC_Exit);
}
if (Sector->SecActTarget != NULL)
{
int act = SECSPAC_Enter;
if (z <= Sector->floorplane.ZatPoint(x, y))
{
act |= SECSPAC_HitFloor;
}
if (z + height >= Sector->ceilingplane.ZatPoint(x, y))
{
act |= SECSPAC_HitCeiling;
}
if (Sector->heightsec != NULL && z == Sector->heightsec->floorplane.ZatPoint(x, y))
{
act |= SECSPAC_HitFakeFloor;
}
Sector->SecActTarget->TriggerAction(this, act);
}
}
}
//==========================================================================
//
// AActor::UpdateWaterLevel