aboutsummaryrefslogtreecommitdiff
path: root/advtrains/debugitems.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2023-10-15 15:48:59 +0200
committerorwell <orwell@bleipb.de>2023-10-15 15:48:59 +0200
commit2067ab0a90550b2fc513e032d4c4e54dd11a2290 (patch)
tree55509b5ef1cfc23e82694f4ccef7c388ae49cb2a /advtrains/debugitems.lua
parentad82b9cd4e12e16a176a2af08d480fa939076515 (diff)
downloadadvtrains-2067ab0a90550b2fc513e032d4c4e54dd11a2290.tar.gz
advtrains-2067ab0a90550b2fc513e032d4c4e54dd11a2290.tar.bz2
advtrains-2067ab0a90550b2fc513e032d4c4e54dd11a2290.zip
Use conn_map in the path calculation
Diffstat (limited to 'advtrains/debugitems.lua')
-rw-r--r--advtrains/debugitems.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/advtrains/debugitems.lua b/advtrains/debugitems.lua
index a59efc7..2236cba 100644
--- a/advtrains/debugitems.lua
+++ b/advtrains/debugitems.lua
@@ -118,3 +118,22 @@ minetest.register_tool("advtrains:trackitest",
end,
}
)
+
+minetest.register_chatcommand("at_trackdef_audit",
+ {
+ params = "",
+ description = "Performs an audit of all track definitions currently loaded and checks for potential problems",
+ func = function(name, param)
+ for name, ndef in pairs(minetest.registered_nodes) do
+ --TODO finish this!
+ if ndef.at_conns then
+ -- check if conn_map is there and if it has enough entries
+ if #ndef.at_conns > 2 then
+ if #ndef.at_conn_map < #ndef.at_conns then
+ atwarn("AUDIT: Node",name,"- Not enough connmap entries! Check ndef:",ndef)
+ end
+ end
+ end
+ end
+ end,
+})