diff options
-rw-r--r-- | advtrains.zip | bin | 4922848 -> 4922942 bytes | |||
-rw-r--r-- | advtrains/advtrains/trainlogic.lua | 9 |
2 files changed, 8 insertions, 1 deletions
diff --git a/advtrains.zip b/advtrains.zip Binary files differindex 58f0f63..271862d 100644 --- a/advtrains.zip +++ b/advtrains.zip diff --git a/advtrains/advtrains/trainlogic.lua b/advtrains/advtrains/trainlogic.lua index 7238d92..1bc732d 100644 --- a/advtrains/advtrains/trainlogic.lua +++ b/advtrains/advtrains/trainlogic.lua @@ -40,7 +40,14 @@ advtrains.audit_interval=10 advtrains.save_and_audit_timer=advtrains.audit_interval -minetest.register_globalstep(function(dtime) +minetest.register_globalstep(function(dtime_mt) + --limit dtime: if trains move too far in one step, automation may cause stuck and wrongly braking trains + local dtime=dtime_mt + if dtime>0.2 then + atprint("Limiting dtime to 0.2!") + dtime=0.2 + end + advtrains.save_and_audit_timer=advtrains.save_and_audit_timer-dtime if advtrains.save_and_audit_timer<=0 then local t=os.clock() |