- fixed use of multiple sector actions in the same sector.

The entire setup was quite broken with each item using its own activation result and the ones of the subsequent items in the list as the return value.
This rendered the STANDSTILL check in the main function totally unpredictable because the value it depended on could come from any item in the list.
Changed it so that the main dispatcher function is part of sector_t and does the stepping through the list iteratively instead of letting each item recursively call its successor and let this function decide for each item alone whether it should be removed.
The broken setup also had the effect that any MusicChanger would trigger all following SecActEnter specials right on msp start.
This commit is contained in:
Christoph Oelckers 2017-01-13 01:34:43 +01:00
commit 1400f401e7
9 changed files with 67 additions and 40 deletions

View file

@ -2810,7 +2810,7 @@ void P_ZMovement (AActor *mo, double oldfloorz)
mo->Sector->SecActTarget != NULL &&
mo->Sector->floorplane.ZatPoint(mo) == mo->floorz)
{ // [RH] Let the sector do something to the actor
mo->Sector->SecActTarget->TriggerAction (mo, SECSPAC_HitFloor);
mo->Sector->TriggerSectorActions (mo, SECSPAC_HitFloor);
}
P_CheckFor3DFloorHit(mo, mo->floorz);
// [RH] Need to recheck this because the sector action might have
@ -2913,7 +2913,7 @@ void P_ZMovement (AActor *mo, double oldfloorz)
mo->Sector->SecActTarget != NULL &&
mo->Sector->ceilingplane.ZatPoint(mo) == mo->ceilingz)
{ // [RH] Let the sector do something to the actor
mo->Sector->SecActTarget->TriggerAction (mo, SECSPAC_HitCeiling);
mo->Sector->TriggerSectorActions (mo, SECSPAC_HitCeiling);
}
P_CheckFor3DCeilingHit(mo, mo->ceilingz);
// [RH] Need to recheck this because the sector action might have
@ -2981,7 +2981,7 @@ void P_CheckFakeFloorTriggers (AActor *mo, double oldz, bool oldz_has_viewheight
if (oldz > waterz && mo->Z() <= waterz)
{ // Feet hit fake floor
sec->SecActTarget->TriggerAction (mo, SECSPAC_HitFakeFloor);
sec->TriggerSectorActions (mo, SECSPAC_HitFakeFloor);
}
newz = mo->Z() + viewheight;
@ -2992,11 +2992,11 @@ void P_CheckFakeFloorTriggers (AActor *mo, double oldz, bool oldz_has_viewheight
if (oldz <= waterz && newz > waterz)
{ // View went above fake floor
sec->SecActTarget->TriggerAction (mo, SECSPAC_EyesSurface);
sec->TriggerSectorActions (mo, SECSPAC_EyesSurface);
}
else if (oldz > waterz && newz <= waterz)
{ // View went below fake floor
sec->SecActTarget->TriggerAction (mo, SECSPAC_EyesDive);
sec->TriggerSectorActions (mo, SECSPAC_EyesDive);
}
if (!(hs->MoreFlags & SECF_FAKEFLOORONLY))
@ -3004,11 +3004,11 @@ void P_CheckFakeFloorTriggers (AActor *mo, double oldz, bool oldz_has_viewheight
waterz = hs->ceilingplane.ZatPoint(mo);
if (oldz <= waterz && newz > waterz)
{ // View went above fake ceiling
sec->SecActTarget->TriggerAction (mo, SECSPAC_EyesAboveC);
sec->TriggerSectorActions (mo, SECSPAC_EyesAboveC);
}
else if (oldz > waterz && newz <= waterz)
{ // View went below fake ceiling
sec->SecActTarget->TriggerAction (mo, SECSPAC_EyesBelowC);
sec->TriggerSectorActions (mo, SECSPAC_EyesBelowC);
}
}
}
@ -4353,7 +4353,7 @@ void AActor::CheckSectorTransition(sector_t *oldsec)
{
if (oldsec->SecActTarget != NULL)
{
oldsec->SecActTarget->TriggerAction(this, SECSPAC_Exit);
oldsec->TriggerSectorActions(this, SECSPAC_Exit);
}
if (Sector->SecActTarget != NULL)
{
@ -4370,7 +4370,7 @@ void AActor::CheckSectorTransition(sector_t *oldsec)
{
act |= SECSPAC_HitFakeFloor;
}
Sector->SecActTarget->TriggerAction(this, act);
Sector->TriggerSectorActions(this, act);
}
if (Z() == floorz)
{