diff options
Diffstat (limited to 'subway/init_code.lua')
-rw-r--r-- | subway/init_code.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/subway/init_code.lua b/subway/init_code.lua index ebe0781..20fd5ad 100644 --- a/subway/init_code.lua +++ b/subway/init_code.lua @@ -1,3 +1,4 @@ +-- 'subway' environment -- --F.stn_union=function(line1, prev1, prev2, this, next, doors, dps, osig, ret_sw, ret_st, nohalt, waittime) F.stationnames={ Ewb="Edenwood Beach", @@ -340,6 +341,13 @@ end end end +local function aspect_is_free(asp) + if type(asp.main) == "table" then + return asp.main.free + else + return asp.main ~= 0 + end +end -- 21.1.19, the rise of tss F.stn_ilk=function(prev, this, next, doors, dps) @@ -353,7 +361,7 @@ F.stn_ilk=function(prev, this, next, doors, dps) if not asp then atc_set_text_inside(F.stnname(this).."\nNo aspect for "..this) else - if asp.main.free then + if aspect_is_free(asp) then atc_set_text_inside("Next stop:\n"..F.stnname(next)) atc_send("OC D1 S"..(dps or "M")) depart = true |