aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-10 21:45:07 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-04-11 13:12:51 +0200
commitf105bc8dc2444d98a9cd74a2caa0013ce2e07008 (patch)
treeb426284edab83f8bda3fbc469d4488c9c1d3b059 /src/script
parentaa3cf400e2ca4096517e926dbae5b6337b2f1876 (diff)
downloadminetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.tar.gz
minetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.tar.bz2
minetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.zip
A few initialization cleanups
Diffstat (limited to 'src/script')
-rw-r--r--src/script/scripting_client.cpp8
-rw-r--r--src/script/scripting_client.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/script/scripting_client.cpp b/src/script/scripting_client.cpp
index 1288b1df7..6643a9509 100644
--- a/src/script/scripting_client.cpp
+++ b/src/script/scripting_client.cpp
@@ -55,9 +55,6 @@ ClientScripting::ClientScripting(Client *client):
InitializeModApi(L, top);
lua_pop(L, 1);
- if (client->getMinimap())
- LuaMinimap::create(L, client->getMinimap());
-
// Push builtin initialization type
lua_pushstring(L, "client");
lua_setglobal(L, "INIT");
@@ -94,3 +91,8 @@ void ClientScripting::on_camera_ready(Camera *camera)
{
LuaCamera::create(getStack(), camera);
}
+
+void ClientScripting::on_minimap_ready(Minimap *minimap)
+{
+ LuaMinimap::create(getStack(), minimap);
+}
diff --git a/src/script/scripting_client.h b/src/script/scripting_client.h
index cfecfa165..3088029f0 100644
--- a/src/script/scripting_client.h
+++ b/src/script/scripting_client.h
@@ -28,6 +28,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class Client;
class LocalPlayer;
class Camera;
+class Minimap;
+
class ClientScripting:
virtual public ScriptApiBase,
public ScriptApiSecurity,
@@ -38,6 +40,7 @@ public:
ClientScripting(Client *client);
void on_client_ready(LocalPlayer *localplayer);
void on_camera_ready(Camera *camera);
+ void on_minimap_ready(Minimap *minimap);
private:
virtual void InitializeModApi(lua_State *L, int top);