diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index feb530eac..f13c7e95a 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -191,7 +191,6 @@ GameController::GameController(): #ifdef LUACONSOLE commandInterface = new LuaScriptInterface(this, gameModel); - ((LuaScriptInterface*)commandInterface)->SetWindow(gameView); #else commandInterface = new TPTScriptInterface(this, gameModel); #endif diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 022a48040..365aee26d 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -144,6 +144,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m): initSimulationAPI(); initInterfaceAPI(); + SetWindow(c->GetView()); initRendererAPI(); initElementsAPI(); initGraphicsAPI();