summaryrefslogtreecommitdiff
path: root/src/client/client.cpp
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/client/client.cpp
parentaa3cf400e2ca4096517e926dbae5b6337b2f1876 (diff)
downloadminetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.tar.gz
minetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.tar.bz2
minetest-f105bc8dc2444d98a9cd74a2caa0013ce2e07008.zip
A few initialization cleanups
Diffstat (limited to 'src/client/client.cpp')
-rw-r--r--src/client/client.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index c9cd24cb3..c3e2a4d2a 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -178,7 +178,7 @@ void Client::loadMods()
infostream << mod.name << " ";
infostream << std::endl;
- // Load and run "mod" scripts
+ // Load "mod" scripts
for (const ModSpec &mod : m_mods) {
if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) {
throw ModError("Error loading mod \"" + mod.name +
@@ -188,7 +188,7 @@ void Client::loadMods()
scanModIntoMemory(mod.name, mod.path);
}
- // Load and run "mod" scripts
+ // Run them
for (const ModSpec &mod : m_mods)
m_script->loadModFromMemory(mod.name);
@@ -197,10 +197,14 @@ void Client::loadMods()
// Run a callback when mods are loaded
m_script->on_mods_loaded();
+
+ // Create objects if they're ready
if (m_state == LC_Ready)
m_script->on_client_ready(m_env.getLocalPlayer());
if (m_camera)
m_script->on_camera_ready(m_camera);
+ if (m_minimap)
+ m_script->on_minimap_ready(m_minimap);
}
bool Client::checkBuiltinIntegrity()