Index: ps/trunk/source/ps/scripting/JSInterface_Game.h =================================================================== --- ps/trunk/source/ps/scripting/JSInterface_Game.h +++ ps/trunk/source/ps/scripting/JSInterface_Game.h @@ -22,6 +22,7 @@ namespace JSI_Game { + bool IsGameStarted(ScriptInterface::CxPrivate* pCxPrivate); void StartGame(ScriptInterface::CxPrivate* pCxPrivate, JS::HandleValue attribs, int playerID); void Script_EndGame(ScriptInterface::CxPrivate* pCxPrivate); int GetPlayerID(ScriptInterface::CxPrivate* pCxPrivate); Index: ps/trunk/source/ps/scripting/JSInterface_Game.cpp =================================================================== --- ps/trunk/source/ps/scripting/JSInterface_Game.cpp +++ ps/trunk/source/ps/scripting/JSInterface_Game.cpp @@ -33,6 +33,11 @@ extern void EndGame(); +bool JSI_Game::IsGameStarted(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) +{ + return g_Game; +} + void JSI_Game::StartGame(ScriptInterface::CxPrivate* pCxPrivate, JS::HandleValue attribs, int playerID) { ENSURE(!g_NetServer); @@ -162,6 +167,7 @@ void JSI_Game::RegisterScriptFunctions(const ScriptInterface& scriptInterface) { + scriptInterface.RegisterFunction("IsGameStarted"); scriptInterface.RegisterFunction("StartGame"); scriptInterface.RegisterFunction("EndGame"); scriptInterface.RegisterFunction("GetPlayerID");