Encapsulate the second behavior branch into an else.

When a tag is provided, the tagged sector-related branch is run exclusively now. This prevents playing the same sound again from the caller object's origin and other unwanted behaviors.

Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
Nev3r 2019-10-14 16:30:20 +02:00
parent ff8c43664a
commit c935797a34
1 changed files with 24 additions and 21 deletions

View File

@ -2718,6 +2718,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
CONS_Debug(DBG_GAMELOGIC, "Line type 414 Executor: sfx number %d is invalid!\n", sfxnum);
return;
}
if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set
{
if (line->flags & ML_EFFECT5) // Repeat Midtexture
@ -2758,7 +2759,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
return;
}
}
else
{
if (line->flags & ML_NOCLIMB)
{
// play the sound from nowhere, but only if display player triggered it
@ -2784,6 +2786,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
S_StartSound(mo, sfxnum);
}
}
}
break;
case 415: // Run a script