Remove FPS from being next to the version string
[oweals/minetest.git] / src / script / scripting_game.cpp
index 043ee4bae879bcd1d4659fd93fcfb337af730c71..e716bc979489bc357617ec2f2d8f4cce73ff95d8 100644 (file)
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "scripting_game.h"
+#include "server.h"
 #include "log.h"
 #include "cpp_api/s_internal.h"
 #include "lua_api/l_base.h"
@@ -50,12 +51,10 @@ GameScripting::GameScripting(Server* server)
 
        //TODO add security
 
-       luaL_openlibs(getStack());
-
        SCRIPTAPI_PRECHECKHEADER
 
-       // Create the main minetest table
-       lua_newtable(L);
+       lua_getglobal(L, "core");
+       int top = lua_gettop(L);
 
        lua_newtable(L);
        lua_setfield(L, -2, "object_refs");
@@ -63,15 +62,15 @@ GameScripting::GameScripting(Server* server)
        lua_newtable(L);
        lua_setfield(L, -2, "luaentities");
 
-       lua_setglobal(L, "minetest");
-
        // Initialize our lua_api modules
-       lua_getglobal(L, "minetest");
-       int top = lua_gettop(L);
        InitializeModApi(L, top);
        lua_pop(L, 1);
 
-       infostream << "SCRIPTAPI: initialized game modules" << std::endl;
+       // Push builtin initialization type
+       lua_pushstring(L, "game");
+       lua_setglobal(L, "INIT");
+
+       infostream << "SCRIPTAPI: Initialized game modules" << std::endl;
 }
 
 void GameScripting::InitializeModApi(lua_State *L, int top)
@@ -99,3 +98,8 @@ void GameScripting::InitializeModApi(lua_State *L, int top)
        ObjectRef::Register(L);
        LuaSettings::Register(L);
 }
+
+void log_deprecated(std::string message)
+{
+       log_deprecated(NULL,message);
+}