diff options
| author | orwell <orwell@bleipb.de> | 2026-01-29 22:35:55 +0100 |
|---|---|---|
| committer | orwell <orwell@bleipb.de> | 2026-01-29 22:35:55 +0100 |
| commit | 41bdf2bcd207ca18e4c97201ecce08b62a3b2f4b (patch) | |
| tree | 271eb997f0557b2b557c9cef85a9f7d8f35b6226 /advtrains_line_automation/line_editor.lua | |
| parent | bb2e1241b73bb6250f3fa1778525eb58501e22b5 (diff) | |
Fix Last Passages formspec after rwt updates
Diffstat (limited to 'advtrains_line_automation/line_editor.lua')
| -rw-r--r-- | advtrains_line_automation/line_editor.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/advtrains_line_automation/line_editor.lua b/advtrains_line_automation/line_editor.lua index bd286c7..4a57d5c 100644 --- a/advtrains_line_automation/line_editor.lua +++ b/advtrains_line_automation/line_editor.lua @@ -794,6 +794,7 @@ local function lp_formspec_callback(custom_state, player, formname, fields) end show_last_passages_formspec = function(player, linevar_def, selected_linevar) + local rwt = advtrains.lines.rwt local formspec = { "formspec_version[6]".. "size[20,10]".. @@ -827,8 +828,8 @@ show_last_passages_formspec = function(player, linevar_def, selected_linevar) for j = 1, 10 do local time = passages[j][1] if time ~= nil then - table.insert(formspec, ",("..rwt.t_str(time)..")") - if max_time[j] < time then + table.insert(formspec, ",("..core.formspec_escape(rwt.t_str(time, 1))..")") + if rwt.is_before(max_time[j], time) then max_time[j] = time end else @@ -842,8 +843,8 @@ show_last_passages_formspec = function(player, linevar_def, selected_linevar) local dep_vych = passages[j][1] local time = passages[j][i] if time ~= nil and dep_vych ~= nil then - table.insert(formspec, ","..(time - dep_vych)) - if max_time[j] < time then + table.insert(formspec, ","..(rwt.diff(dep_vych, time))) + if rwt.is_before(max_time[j], time) then max_time[j] = time end else @@ -854,7 +855,7 @@ show_last_passages_formspec = function(player, linevar_def, selected_linevar) table.insert(formspec, ",,"..S("Travelling:")) for i = 1, 10 do if max_time[i] ~= 0 then - table.insert(formspec, ",_"..(max_time[i] - passages[i][1]).."_") + table.insert(formspec, ",_"..(rwt.diff(passages[i][1], max_time[i])).."_") else table.insert(formspec, ",-") end |
