Fix crash if any built-in scripts try to use the interface api

We don't have any scripts like this and never will. But if we did, this would fix the crash.
This commit is contained in:
jacob1
2019-10-17 23:56:22 -04:00
parent 5f7dd033ec
commit 9ed7f1e85a
2 changed files with 1 additions and 1 deletions

View File

@@ -191,7 +191,6 @@ GameController::GameController():
#ifdef LUACONSOLE #ifdef LUACONSOLE
commandInterface = new LuaScriptInterface(this, gameModel); commandInterface = new LuaScriptInterface(this, gameModel);
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
#else #else
commandInterface = new TPTScriptInterface(this, gameModel); commandInterface = new TPTScriptInterface(this, gameModel);
#endif #endif

View File

@@ -144,6 +144,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
initSimulationAPI(); initSimulationAPI();
initInterfaceAPI(); initInterfaceAPI();
SetWindow(c->GetView());
initRendererAPI(); initRendererAPI();
initElementsAPI(); initElementsAPI();
initGraphicsAPI(); initGraphicsAPI();