mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-21 11:21:11 +00:00
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:
parent
ff8c43664a
commit
c935797a34
1 changed files with 24 additions and 21 deletions
45
src/p_spec.c
45
src/p_spec.c
|
@ -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);
|
CONS_Debug(DBG_GAMELOGIC, "Line type 414 Executor: sfx number %d is invalid!\n", sfxnum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set
|
if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set
|
||||||
{
|
{
|
||||||
if (line->flags & ML_EFFECT5) // Repeat Midtexture
|
if (line->flags & ML_EFFECT5) // Repeat Midtexture
|
||||||
|
@ -2758,30 +2759,32 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (line->flags & ML_NOCLIMB)
|
|
||||||
{
|
{
|
||||||
// play the sound from nowhere, but only if display player triggered it
|
if (line->flags & ML_NOCLIMB)
|
||||||
if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer]))
|
{
|
||||||
|
// play the sound from nowhere, but only if display player triggered it
|
||||||
|
if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer]))
|
||||||
|
S_StartSound(NULL, sfxnum);
|
||||||
|
}
|
||||||
|
else if (line->flags & ML_EFFECT4)
|
||||||
|
{
|
||||||
|
// play the sound from nowhere
|
||||||
S_StartSound(NULL, sfxnum);
|
S_StartSound(NULL, sfxnum);
|
||||||
}
|
}
|
||||||
else if (line->flags & ML_EFFECT4)
|
else if (line->flags & ML_BLOCKMONSTERS)
|
||||||
{
|
{
|
||||||
// play the sound from nowhere
|
// play the sound from calling sector's soundorg
|
||||||
S_StartSound(NULL, sfxnum);
|
if (callsec)
|
||||||
}
|
S_StartSound(&callsec->soundorg, sfxnum);
|
||||||
else if (line->flags & ML_BLOCKMONSTERS)
|
else if (mo)
|
||||||
{
|
S_StartSound(&mo->subsector->sector->soundorg, sfxnum);
|
||||||
// play the sound from calling sector's soundorg
|
}
|
||||||
if (callsec)
|
|
||||||
S_StartSound(&callsec->soundorg, sfxnum);
|
|
||||||
else if (mo)
|
else if (mo)
|
||||||
S_StartSound(&mo->subsector->sector->soundorg, sfxnum);
|
{
|
||||||
}
|
// play the sound from mobj that triggered it
|
||||||
else if (mo)
|
S_StartSound(mo, sfxnum);
|
||||||
{
|
}
|
||||||
// play the sound from mobj that triggered it
|
|
||||||
S_StartSound(mo, sfxnum);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue