forked from 0ad/0ad
double check that the sound manager has been created before using
This was SVN commit r13353.
This commit is contained in:
parent
b301d5c84d
commit
0cad19ecec
@ -72,12 +72,14 @@ InReaction GlobalsInputHandler(const SDL_Event_* ev)
|
||||
if(ev->ev.active.state & SDL_APPACTIVE)
|
||||
{
|
||||
g_app_minimized = (ev->ev.active.gain == 0); // negated
|
||||
g_SoundManager->Pause( g_app_minimized && g_PauseOnFocusLoss && !g_NetClient );
|
||||
if ( g_SoundManager )
|
||||
g_SoundManager->Pause( g_app_minimized && g_PauseOnFocusLoss && !g_NetClient );
|
||||
}
|
||||
if(ev->ev.active.state & SDL_APPINPUTFOCUS)
|
||||
{
|
||||
g_app_has_focus = (ev->ev.active.gain != 0);
|
||||
g_SoundManager->Pause( !g_app_has_focus && g_PauseOnFocusLoss && !g_NetClient );
|
||||
if ( g_SoundManager )
|
||||
g_SoundManager->Pause( !g_app_has_focus && g_PauseOnFocusLoss && !g_NetClient );
|
||||
}
|
||||
if(ev->ev.active.state & SDL_APPMOUSEFOCUS)
|
||||
g_mouse_active = (ev->ev.active.gain != 0);
|
||||
|
@ -341,7 +341,8 @@ JSBool SetPaused(JSContext* cx, uintN argc, jsval* vp)
|
||||
try
|
||||
{
|
||||
g_Game->m_Paused = ToPrimitive<bool> (JS_ARGV(cx, vp)[0]);
|
||||
g_SoundManager->Pause(g_Game->m_Paused);
|
||||
if ( g_SoundManager )
|
||||
g_SoundManager->Pause(g_Game->m_Paused);
|
||||
}
|
||||
catch (PSERROR_Scripting_ConversionFailed)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user