aboutsummaryrefslogtreecommitdiff
path: root/advtrains/advtrains_itrainmap
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/advtrains_itrainmap')
-rw-r--r--advtrains/advtrains_itrainmap/init.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/advtrains/advtrains_itrainmap/init.lua b/advtrains/advtrains_itrainmap/init.lua
index 96e30c5..756f1da 100644
--- a/advtrains/advtrains_itrainmap/init.lua
+++ b/advtrains/advtrains_itrainmap/init.lua
@@ -128,7 +128,7 @@ minetest.register_chatcommand("itm_cache_ndb", {
})
local timer=0
-minetest.register_globalstep(function(dtime)
+function advtrains_itm_mainloop(dtime)
timer=timer-math.min(dtime, 0.1)
if timer<=0 then
for pname,d in pairs(itm_pdata) do
@@ -136,12 +136,14 @@ minetest.register_globalstep(function(dtime)
end
timer=2
end
-end)
+end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname=="itrainmap" and fields.quit then
itm_pdata[player:get_player_name()]=nil
end
end)
---automatically run itm_cache_ndb
-minetest.after(2, cache_ndb)
+function advtrains_itm_init()
+ --automatically run itm_cache_ndb
+ minetest.after(2, cache_ndb)
+end