mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 01:52:31 +00:00
startGame() shouldn't crash and burn if the game's already been started
This was SVN commit r1181.
This commit is contained in:
@@ -350,9 +350,12 @@ JSBool startGame(JSContext* cx, JSObject* UNUSEDPARAM(globalObject), unsigned in
|
||||
}
|
||||
if (g_NetServer)
|
||||
g_NetServer->StartGame();
|
||||
else if (g_NetClient) // startGame is invalid on joined games; do nothing and return an error
|
||||
return JS_FALSE;
|
||||
else
|
||||
else if (g_NetClient) // startGame is invalid on joined games; do nothing and return false
|
||||
{
|
||||
*rval=BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
else if (!g_Game)
|
||||
{
|
||||
g_Game=new CGame();
|
||||
g_Game->StartGame(&g_GameAttributes);
|
||||
|
||||
Reference in New Issue
Block a user