Skip to content

Commit

Permalink
- fixed crash when playing sounds with no level loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Jan 11, 2019
1 parent 4ee7827 commit e68b3f6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/s_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,15 +991,18 @@ static FSoundChan *S_StartSound(FLevelLocals *Level, AActor *actor, const sector
return nullptr;
}

if (Level->i_compatflags & COMPATF_MAGICSILENCE)
{ // For people who just can't play without a silent BFG.
channel = CHAN_WEAPON;
}
else if ((chanflags & CHAN_MAYBE_LOCAL) && (Level->i_compatflags & COMPATF_SILENTPICKUP))
if (Level != nullptr)
{
if (actor != NULL && actor != players[consoleplayer].camera)
if (Level->i_compatflags & COMPATF_MAGICSILENCE)
{ // For people who just can't play without a silent BFG.
channel = CHAN_WEAPON;
}
else if ((chanflags & CHAN_MAYBE_LOCAL) && (Level->i_compatflags & COMPATF_SILENTPICKUP))
{
return NULL;
if (actor != nullptr && actor != players[consoleplayer].camera)
{
return nullptr;
}
}
}

Expand Down

0 comments on commit e68b3f6

Please sign in to comment.