1
0
forked from mirrors/0ad

Protect against missing globals when loading GUI in unusual ways

This was SVN commit r7550.
This commit is contained in:
Ykkrosh
2010-05-20 00:57:03 +00:00
parent 78ccac427d
commit 8c1a3f7c8a
2 changed files with 3 additions and 2 deletions
@@ -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();