forked from mirrors/0ad
Protect against missing globals when loading GUI in unusual ways
This was SVN commit r7550.
This commit is contained in:
@@ -35,7 +35,7 @@ function init()
|
||||
function reallyStartGame()
|
||||
{
|
||||
// Stop the music
|
||||
if (curr_music)
|
||||
if (typeof curr_music != "undefined" && curr_music)
|
||||
curr_music.fade(-1, 0.0, 5.0); // fade to 0 over 5 seconds
|
||||
|
||||
// This is a reserved function name that is executed by the engine when it is ready
|
||||
|
||||
@@ -40,7 +40,8 @@ function setupSession ()
|
||||
// Select session peace track.
|
||||
curr_session_playlist_1 = newRandomSound("music", "peace");
|
||||
// Fade out main theme and fade in session theme.
|
||||
crossFade(curr_music, curr_session_playlist_1, 1)
|
||||
if (typeof curr_music != "undefined" && curr_music)
|
||||
crossFade(curr_music, curr_session_playlist_1, 1)
|
||||
|
||||
// Create the resouce counters
|
||||
createResourceCounters();
|
||||
|
||||
Reference in New Issue
Block a user