diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:40 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:57:40 +0200 |
commit | 387155be168afea0d3917b6d9936d301ca33b03a (patch) | |
tree | e3ec3e72809db59d332cd407ec9f680bc14d4a1e /auto_yards | |
parent | 21b3997259ef9559c56e114e1733049dd2ebe8ac (diff) | |
download | luaatc_envs-387155be168afea0d3917b6d9936d301ca33b03a.tar.gz luaatc_envs-387155be168afea0d3917b6d9936d301ca33b03a.tar.bz2 luaatc_envs-387155be168afea0d3917b6d9936d301ca33b03a.zip |
State at 2022-06-14
Diffstat (limited to 'auto_yards')
-rw-r--r-- | auto_yards/init_code.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/auto_yards/init_code.lua b/auto_yards/init_code.lua index 6286947..0664eb9 100644 --- a/auto_yards/init_code.lua +++ b/auto_yards/init_code.lua @@ -100,7 +100,7 @@ F.remove_rc = function(rc_list,arrow_mode) -- rc_list = string eg: "rc1 rc2 rc3" -- prep rc_list to useable format local rc_remove = {} if type(rc_list) == "string" then - for word in pairs(rc_list:gmatch("[^%s]+")) do + for word in rc_list:gmatch("[^%s]+") do rc_remove[word] = true end elseif type(rc_list) == "table" then @@ -146,15 +146,19 @@ F.yard_arrival = function(yard_id,this_dir) -- arrow points towards yard local function enter_yard() if not atc_id then F.indicator(yard.error_indicator_pos,true) + return end F.indicator(yard.dir_indicator_pos,this_dir) F.indicator(yard.active_indicator_pos,true) F.add_rc({yard_id.."_ARRIVE"}) + local rts = false if F.has_rc(yard_id.."_RTS") then --save the RTS flag as it's removed during the arrival procedure F.add_rc({yard_id.."_HAS_RTS"}) + rts = true end atc_set_ars_disable(false) atc_send("S6") + print("Train "..atc_id.." enters yard ".. yard_id.." from the "..tostring(this_dir).." direction and "..((rts and "will") or "won't").." return in the same direction") return end @@ -357,7 +361,7 @@ F.headshunt_exit = function(yard_id,this_dir) -- arrow points out of yard schedule_in(";05","deactivate_check") -- wait a little to ensure train is clear from headshunt to deactivate yard print(F.get_rc_safe()) return - end + end -- if not _DEPART then let the train pass as extra space for the bounce back to the yard else atc_send("BBOL") F.indicator(yard.error_indicator_pos,true) |