aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-01-14 11:08:16 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 16:42:15 +0100
commit1b8a3dfaf21cd485b7018491c70ebff4c639bfcf (patch)
tree3692266b5244096e991d51882f7875e93d38ca94 /advtrains/init.lua
parent4d13b158420d4a8d5fc0020ee2b0f9a0014c5541 (diff)
downloadadvtrains-1b8a3dfaf21cd485b7018491c70ebff4c639bfcf.tar.gz
advtrains-1b8a3dfaf21cd485b7018491c70ebff4c639bfcf.tar.bz2
advtrains-1b8a3dfaf21cd485b7018491c70ebff4c639bfcf.zip
Add save interval setting, fix accidental global variable, at_sync_ndb on server priv not limited, timetaking for restore_all
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r--advtrains/init.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index 13e5f70..2e10530 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -52,7 +52,7 @@ local NO_SAVE = false
-- Use a global slowdown factor to slow down train movements. Now a setting
local DTIME_LIMIT = tonumber(minetest.settings:get("advtrains_dtime_limit")) or 0.2
-
+local SAVE_INTERVAL = tonumber(minetest.settings:get("advtrains_save_interval")) or 60
--Constant for maximum connection value/division of the circle
AT_CMAX = 16
@@ -564,8 +564,7 @@ end
--## MAIN LOOP ##--
--Calls all subsequent main tasks of both advtrains and atlatc
local init_load=false
-local save_interval=60
-local save_timer=save_interval
+local save_timer = SAVE_INTERVAL
advtrains.mainloop_runcnt=0
advtrains.global_slowdown = 1
@@ -624,7 +623,7 @@ minetest.register_globalstep(function(dtime_mt)
local t=os.clock()
--save
advtrains.save()
- save_timer=save_interval
+ save_timer = SAVE_INTERVAL
atprintbm("saving", t)
end
end)