From caf2bda7bc02f0bbe6dbbeb415e7881158d143b9 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 26 Apr 2018 23:35:19 +0200 Subject: Fix path_dir to actually be an angle, path item deletion and orientation of wagons The occupation system as it is now will change. For each position, I will save the index in the train's path, and implement a callback system. I need this because the occupation window system will not be enough to cover all use cases (e.g. to make a train stop with it's center or back at a certain position, I need 3 different brake distances, which doesn't fit into the scheme) --- advtrains/occupation.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains/occupation.lua') diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua index 7af4a3d..e72d668 100644 --- a/advtrains/occupation.lua +++ b/advtrains/occupation.lua @@ -227,14 +227,14 @@ function handle_chg(t, pos, train_id, old, new) if #blocking > 0 then -- the aware trains should brake for _, ix in ipairs(aware) do - atc.train_set_command(t[ix], "B2") + advtrains.atc.train_set_command(t[ix], "B2") end if #blocking > 1 then -- not good, 2 trains interfered with their blocking zones -- make them brake too local txt = {} for _, ix in ipairs(blocking) do - atc.train_set_command(t[ix], "B2") + advtrains.atc.train_set_command(t[ix], "B2") txt[#txt+1] = t[ix] end atwarn("Trains",table.concat(txt, ","), "interfered with their blocking zones, braking...") -- cgit v1.2.3