diff --git a/source/ps/scripting/JSInterface_Game.cpp b/source/ps/scripting/JSInterface_Game.cpp index c6752ccf41..7d967f4545 100644 --- a/source/ps/scripting/JSInterface_Game.cpp +++ b/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::DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) void JSI_Game::RegisterScriptFunctions(const ScriptInterface& scriptInterface) { + scriptInterface.RegisterFunction("IsGameStarted"); scriptInterface.RegisterFunction("StartGame"); scriptInterface.RegisterFunction("EndGame"); scriptInterface.RegisterFunction("GetPlayerID"); diff --git a/source/ps/scripting/JSInterface_Game.h b/source/ps/scripting/JSInterface_Game.h index 3e88bf0073..8862a9e861 100644 --- a/source/ps/scripting/JSInterface_Game.h +++ b/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);