diff options
author | orwell <orwell@bleipb.de> | 2023-10-15 15:48:59 +0200 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2023-10-15 15:48:59 +0200 |
commit | 2067ab0a90550b2fc513e032d4c4e54dd11a2290 (patch) | |
tree | 55509b5ef1cfc23e82694f4ccef7c388ae49cb2a /advtrains/debugitems.lua | |
parent | ad82b9cd4e12e16a176a2af08d480fa939076515 (diff) | |
download | advtrains-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.lua | 19 |
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, +}) |