From 24b0639c5f057ccb0fccc3c65be923bee1b571db Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 17 May 2018 21:37:01 +0200 Subject: Mainly make collisions and coupling work Missing: ATC stuff, yaw problems --- advtrains/atc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains/atc.lua') diff --git a/advtrains/atc.lua b/advtrains/atc.lua index 1d3b04c..480c043 100644 --- a/advtrains/atc.lua +++ b/advtrains/atc.lua @@ -30,7 +30,7 @@ function atc.send_command(pos, par_tid) local pts=minetest.pos_to_string(pos) if atc.controllers[pts] then --atprint("Called send_command at "..pts) - local train_id = par_tid or advtrains.detector.get(pos) -- TODO: succesively replace those detector calls! + local train_id = par_tid or advtrains.get_train_at_pos(pos) if train_id then if advtrains.trains[train_id] then --atprint("send_command inside if: "..sid(train_id)) @@ -131,7 +131,7 @@ advtrains.atc_function = function(def, preset, suffix, rotation) local pts=minetest.pos_to_string(pos) local _, conns=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) atc.controllers[pts]={command=fields.command} - if advtrains.detector.get(pos) then + if #advtrains.occ.get_trains_at(pos) > 0 then atc.send_command(pos) end end -- cgit v1.2.3