aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-05-17 21:37:01 +0200
committerorwell96 <orwell@bleipb.de>2018-06-14 17:39:42 +0200
commit24b0639c5f057ccb0fccc3c65be923bee1b571db (patch)
treebe7ece8c6c70701dc02ee68cf86998f310efd2ec /advtrains/atc.lua
parent5dca1553333b8267de72ebf8788afbb928251ebf (diff)
downloadadvtrains-24b0639c5f057ccb0fccc3c65be923bee1b571db.tar.gz
advtrains-24b0639c5f057ccb0fccc3c65be923bee1b571db.tar.bz2
advtrains-24b0639c5f057ccb0fccc3c65be923bee1b571db.zip
Mainly make collisions and coupling work
Missing: ATC stuff, yaw problems
Diffstat (limited to 'advtrains/atc.lua')
-rw-r--r--advtrains/atc.lua4
1 files changed, 2 insertions, 2 deletions
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