diff options
Diffstat (limited to 'advtrains_line_automation')
-rw-r--r-- | advtrains_line_automation/railwaytime.lua | 7 | ||||
-rw-r--r-- | advtrains_line_automation/stoprail.lua | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/advtrains_line_automation/railwaytime.lua b/advtrains_line_automation/railwaytime.lua index 3a044b6..258009e 100644 --- a/advtrains_line_automation/railwaytime.lua +++ b/advtrains_line_automation/railwaytime.lua @@ -39,6 +39,7 @@ local rwt = {} --Time Stamp (Seconds since start of world) local e_time = 0 +local e_has_loaded = false local setting_rwt_real = minetest.settings:get("advtrains_lines_rwt_realtime") if setting_rwt_real=="" then @@ -71,6 +72,8 @@ function rwt.set_time(t) end atlog("[lines][rwt] Initialized railway time: ",rwt.to_string(e_time)) e_last_epoch = os.time() + + e_has_loaded = true end function rwt.get_time() @@ -78,6 +81,10 @@ function rwt.get_time() end function rwt.step(dt) + if not e_has_loaded then + rwt.set_time(0) + end + if setting_rwt_real=="independent" then -- Regular stepping with dtime e_time = e_time + dt diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua index 0db474f..0990876 100644 --- a/advtrains_line_automation/stoprail.lua +++ b/advtrains_line_automation/stoprail.lua @@ -58,7 +58,7 @@ local function show_stoprailform(pos, player) form = form.."dropdown[0.5,3;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]" form = form.."dropdown[3,3;1.5;reverse;---,Reverse;"..(stdata.reverse and 2 or 1).."]" - form = form.."field[5,3.5;2,1;track;"..attrans("Track")..";"..stdata.track.."]" + form = form.."field[5,3.5;2,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]" form = form.."field[5,4.5;2,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]" form = form.."textarea[0.5,4;4,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]" |