aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/database.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-10-07 22:21:49 +0200
committerorwell96 <orwell@bleipb.de>2018-10-07 22:21:49 +0200
commit8df7bcf6b6ea6333b3df925af528e23574974d69 (patch)
tree416d247272b6d6878b6e5024eca6965c21d81c22 /advtrains_interlocking/database.lua
parent8e70c070c1be102a679ff3fd6f71669c883ec510 (diff)
downloadadvtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.tar.gz
advtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.tar.bz2
advtrains-8df7bcf6b6ea6333b3df925af528e23574974d69.zip
Improve route programming:
- Formspec for TCBs instead of unhandy chatcommands - Ability to advance route over the next secction without punching end - Better visualization - Ability to route into dead-end sections
Diffstat (limited to 'advtrains_interlocking/database.lua')
-rw-r--r--advtrains_interlocking/database.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua
index f71d911..f3df5e1 100644
--- a/advtrains_interlocking/database.lua
+++ b/advtrains_interlocking/database.lua
@@ -250,7 +250,7 @@ end
local function traverser(found_tcbs, pos, conns, connid, count, brk_when_found_n)
local adj_pos, adj_connid, conn_idx, nextrail_y, next_conns = advtrains.get_adjacent_rail(pos, conns, connid, advtrains.all_tracktypes)
if not adj_pos then
- atdebug("Traverser found end-of-track at",pos, connid)
+ --atdebug("Traverser found end-of-track at",pos, connid)
return
end
-- look whether there is a TCB here
@@ -258,14 +258,14 @@ local function traverser(found_tcbs, pos, conns, connid, count, brk_when_found_n
local tcb = ildb.get_tcb(adj_pos)
if tcb then
-- done with this branch
- atdebug("Traverser found tcb at",adj_pos, adj_connid)
+ --atdebug("Traverser found tcb at",adj_pos, adj_connid)
insert_sigd_nodouble(found_tcbs, {p=adj_pos, s=adj_connid})
return
end
end
-- recursion abort condition
if count > TRAVERSER_LIMIT then
- atdebug("Traverser hit counter at",adj_pos, adj_connid)
+ --atdebug("Traverser hit counter at",adj_pos, adj_connid)
return true
end
-- continue traversing
@@ -316,7 +316,7 @@ function ildb.sync_tcb_neighbors(pos, connid)
error("update_tcb_neighbors but node is NOK: "..minetest.pos_to_string(pos))
end
- atdebug("Traversing from ",pos, connid)
+ --atdebug("Traversing from ",pos, connid)
local counter_hit = traverser(found_tcbs, pos, conns, connid, 0)
local ts_id
@@ -328,7 +328,7 @@ function ildb.sync_tcb_neighbors(pos, connid)
for idx, sigd in pairs(found_tcbs) do
local tcbs = ildb.get_tcbs(sigd)
if not tcbs.ts_id then
- atdebug("Sync: put",sigd_to_string(sigd),"into list_eoi")
+ --atdebug("Sync: put",sigd_to_string(sigd),"into list_eoi")
table.insert(list_eoi, sigd)
elseif not ts_id and tcbs.ts_id then
if not ildb.get_ts(tcbs.ts_id) then
@@ -336,7 +336,7 @@ function ildb.sync_tcb_neighbors(pos, connid)
tcbs.ts_id = nil
table.insert(list_eoi, sigd)
else
- atdebug("Sync: put",sigd_to_string(sigd),"into list_ok")
+ --atdebug("Sync: put",sigd_to_string(sigd),"into list_ok")
ts_id = tcbs.ts_id
table.insert(list_ok, sigd)
end