aboutsummaryrefslogtreecommitdiff
path: root/advtrains/advtrains_itrainmap/init.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-04-29 19:13:15 +0200
committerorwell96 <mono96.mml@gmail.com>2017-04-29 19:13:15 +0200
commit331db7ba5f4e4b308c1f8efa93c2b40c5139766d (patch)
treec9dc5d02d6c1986ef420004f94154c61be0cc1a9 /advtrains/advtrains_itrainmap/init.lua
parent337db2a573ccaa1672e713855022e96106679803 (diff)
downloadadvtrains-331db7ba5f4e4b308c1f8efa93c2b40c5139766d.tar.gz
advtrains-331db7ba5f4e4b308c1f8efa93c2b40c5139766d.tar.bz2
advtrains-331db7ba5f4e4b308c1f8efa93c2b40c5139766d.zip
Unify globalstep, load and save of all components into single functions
Diffstat (limited to 'advtrains/advtrains_itrainmap/init.lua')
-rw-r--r--advtrains/advtrains_itrainmap/init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/advtrains/advtrains_itrainmap/init.lua b/advtrains/advtrains_itrainmap/init.lua
index 96e30c5..85a3709 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
@@ -143,5 +143,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
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