mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-03 09:22:31 +00:00
- fixed crash when playing sounds with no level loaded
This commit is contained in:
parent
4ee7827d2c
commit
e68b3f6694
1 changed files with 10 additions and 7 deletions
|
@ -991,15 +991,18 @@ static FSoundChan *S_StartSound(FLevelLocals *Level, AActor *actor, const sector
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Level != nullptr)
|
||||||
|
{
|
||||||
if (Level->i_compatflags & COMPATF_MAGICSILENCE)
|
if (Level->i_compatflags & COMPATF_MAGICSILENCE)
|
||||||
{ // For people who just can't play without a silent BFG.
|
{ // For people who just can't play without a silent BFG.
|
||||||
channel = CHAN_WEAPON;
|
channel = CHAN_WEAPON;
|
||||||
}
|
}
|
||||||
else if ((chanflags & CHAN_MAYBE_LOCAL) && (Level->i_compatflags & COMPATF_SILENTPICKUP))
|
else if ((chanflags & CHAN_MAYBE_LOCAL) && (Level->i_compatflags & COMPATF_SILENTPICKUP))
|
||||||
{
|
{
|
||||||
if (actor != NULL && actor != players[consoleplayer].camera)
|
if (actor != nullptr && actor != players[consoleplayer].camera)
|
||||||
{
|
{
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue