digtron
digtron copied to clipboard
Digtron extrudtion ignoring protection
See C-C-Minetest-Server/twi_mods#35
Digtron builders are not checking for protection in the extruded length. This can be used to violate protections and leave behind a mess.
Patches/suggestions are welcome. I don't really know how this mod works.
Some notes:
Problem comes from class_layout.lua. While discovering nodes belonging to digtron, this class also builds a map of protected nodes around. This will speed up later checks (just have to check node is not in protected list).
But there is a problem, Only nodes just around digtron are checked. All others are considered as not protected. So when performing extrusion, any node too far for having been checked is considered unprotected.
First idea: keep a list of known unprotected nodes aside the protected node list. So when looking for a node, we can know if it has not been checked yet and check it (and add it to one of those lists).
#116