- 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:
parent
cf39af0642
commit
1400f401e7
9 changed files with 67 additions and 40 deletions
|
|
@ -2616,11 +2616,11 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
|
|||
|
||||
if (!oldAboveFakeFloor && eyez > fakez)
|
||||
{ // View went above fake floor
|
||||
newsec->SecActTarget->TriggerAction(thing, SECSPAC_EyesSurface);
|
||||
newsec->TriggerSectorActions(thing, SECSPAC_EyesSurface);
|
||||
}
|
||||
else if (oldAboveFakeFloor && eyez <= fakez)
|
||||
{ // View went below fake floor
|
||||
newsec->SecActTarget->TriggerAction(thing, SECSPAC_EyesDive);
|
||||
newsec->TriggerSectorActions(thing, SECSPAC_EyesDive);
|
||||
}
|
||||
|
||||
if (!(hs->MoreFlags & SECF_FAKEFLOORONLY))
|
||||
|
|
@ -2628,11 +2628,11 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
|
|||
fakez = hs->ceilingplane.ZatPoint(pos);
|
||||
if (!oldAboveFakeCeiling && eyez > fakez)
|
||||
{ // View went above fake ceiling
|
||||
newsec->SecActTarget->TriggerAction(thing, SECSPAC_EyesAboveC);
|
||||
newsec->TriggerSectorActions(thing, SECSPAC_EyesAboveC);
|
||||
}
|
||||
else if (oldAboveFakeCeiling && eyez <= fakez)
|
||||
{ // View went below fake ceiling
|
||||
newsec->SecActTarget->TriggerAction(thing, SECSPAC_EyesBelowC);
|
||||
newsec->TriggerSectorActions(thing, SECSPAC_EyesBelowC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5304,7 +5304,7 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end,
|
|||
|
||||
sec = usething->Sector;
|
||||
|
||||
if (sec->SecActTarget && sec->SecActTarget->TriggerAction(usething, SECSPAC_Use))
|
||||
if (sec->SecActTarget && sec->TriggerSectorActions(usething, SECSPAC_Use))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -5313,7 +5313,7 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end,
|
|||
in->d.line->frontsector : in->d.line->backsector;
|
||||
|
||||
if (sec != NULL && sec->SecActTarget &&
|
||||
sec->SecActTarget->TriggerAction(usething, SECSPAC_UseWall))
|
||||
sec->TriggerSectorActions(usething, SECSPAC_UseWall))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -5434,7 +5434,7 @@ void P_UseLines(player_t *player)
|
|||
sector_t *sec = player->mo->Sector;
|
||||
int spac = SECSPAC_Use;
|
||||
if (foundline) spac |= SECSPAC_UseWall;
|
||||
if ((!sec->SecActTarget || !sec->SecActTarget->TriggerAction(player->mo, spac)) &&
|
||||
if ((!sec->SecActTarget || !sec->TriggerSectorActions(player->mo, spac)) &&
|
||||
P_NoWayTraverse(player->mo, start, end))
|
||||
{
|
||||
S_Sound(player->mo, CHAN_VOICE, "*usefail", 1, ATTN_IDLE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue