aboutsummaryrefslogtreecommitdiff
path: root/advtrains_itrainmap
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-08-18 22:17:20 +0200
committerorwell96 <orwell@bleipb.de>2020-09-01 15:20:15 +0200
commit00be2b5b5fc75de16c178d503ed557e5ddf28c2a (patch)
tree6a86c5b0f60eafe69db3fc1bcc5e56969f264eb3 /advtrains_itrainmap
parente4ccf8ffce10660ebf367517b12f9858fc572917 (diff)
downloadadvtrains-00be2b5b5fc75de16c178d503ed557e5ddf28c2a.tar.gz
advtrains-00be2b5b5fc75de16c178d503ed557e5ddf28c2a.tar.bz2
advtrains-00be2b5b5fc75de16c178d503ed557e5ddf28c2a.zip
tcb: Fix crash when player is nil
Diffstat (limited to 'advtrains_itrainmap')
0 files changed, 0 insertions, 0 deletions
pt">= 0 for _ in pairs(t) do count = count+1 end return count end local txt = {} local txt2 = {} txt[#txt+1] = yard_id.." --"..info.yard_name.." Yard--" txt[#txt+1] = "Active: " .. tostring(F.indicator(info.active_indicator_pos)) txt[#txt+1] = "Direction: " .. tostring(F.indicator(info.dir_indicator_pos)) txt[#txt+1] = "Last Train: " .. tostring(S.known_trains[info.last_id] or info.last_id).." ("..tostring(info.arrival_length).."-"..tostring(info.departure_length)..")" txt2[#txt2+1] = "Time: "..tostring(rwt.to_string(info.arrival_time)).."+"..tostring(rwt.to_string(rwt.diff(info.arrival_time,info.departure_time))) digiline_send(yard_id.."_1",table.concat(txt,"\n")) txt2[#txt2+1] = "RTS: "..tostring(info.rts) txt2[#txt2+1] = "Error: ".. tostring(F.indicator(info.error_indicator_pos)) txt2[#txt2+1] = "" digiline_send(yard_id.."_2",table.concat(txt2,"\n")) local notifications = "" if info.notify then local nt = "" if getN(info.notify) > 0 then nt = "Notify: " for k in pairs(info.notify) do nt = nt..k..", " end else nt = "Notify: No Notifications" end local st_len = 26 if nt:len() > st_len then nt = nt:sub(1,st_len).."\n"..nt:sub(st_len+1) end notifications = nt else notifications = "Notify: Not Enabled" end digiline_send(yard_id.."_NOTIFY",notifications) return end