aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-10-07 14:54:04 +0200
committerorwell96 <orwell@bleipb.de>2020-10-07 14:54:04 +0200
commitd89b8b1c8963e7dde59590efbdb2862c2a431c3d (patch)
treeb5c8d49e2212ce2c9690882eead818a0c0498ee7
parentb892d793ac22a00ee8708b4697d83c0d0ca06743 (diff)
downloadadvtrains-d89b8b1c8963e7dde59590efbdb2862c2a431c3d.tar.gz
advtrains-d89b8b1c8963e7dde59590efbdb2862c2a431c3d.tar.bz2
advtrains-d89b8b1c8963e7dde59590efbdb2862c2a431c3d.zip
Fix schedule_in() crash when RWT is not in number format (H#159)
-rw-r--r--advtrains_line_automation/scheduler.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/advtrains_line_automation/scheduler.lua b/advtrains_line_automation/scheduler.lua
index 8afaa55..6025b02 100644
--- a/advtrains_line_automation/scheduler.lua
+++ b/advtrains_line_automation/scheduler.lua
@@ -113,7 +113,8 @@ end
-- See enqueue(). Same meaning, except that rwtime is relative to now.
function sched.enqueue_in(rwtime, handler, evtdata, unitid, unitlim)
local ctime = ln.rwt.get_time()
- sched.enqueue(ctime + rwtime, handler, evtdata, unitid, unitlim)
+ local rwtime_s = ln.rwt.to_secs(rwtime)
+ sched.enqueue(ctime + rwtime_s, handler, evtdata, unitid, unitlim)
end
-- Discards all schedules for unit "unitid" (removes them from the queue)