]> git.lizzy.rs Git - minetest.git/commitdiff
Item entity: Delete in 'ignore' nodes
authorparamat <paramat@users.noreply.github.com>
Sat, 10 Feb 2018 04:55:40 +0000 (04:55 +0000)
committerparamat <mat.gregory@virginmedia.com>
Tue, 13 Feb 2018 03:48:34 +0000 (03:48 +0000)
builtin/game/item_entity.lua

index a184677643194c95fc5c167401ec98d61820a524..4dca6117dab5732a6f98a4a6cd88768dd59fb130 100644 (file)
@@ -145,11 +145,17 @@ core.register_entity(":__builtin:item", {
                        y = pos.y + self.object:get_properties().collisionbox[2] - 0.05,
                        z = pos.z
                })
+               -- Delete in 'ignore' nodes
+               if node and node.name == "ignore" then
+                       self.itemstring = ""
+                       self.object:remove()
+                       return
+               end
+
                local vel = self.object:getvelocity()
                local def = node and core.registered_nodes[node.name]
-               -- Avoid entity falling into ignore nodes or unloaded areas
-               local is_moving = node and node.name ~= "ignore" and
-                       ((def and not def.walkable) or vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0)
+               local is_moving = (def and not def.walkable) or
+                       vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0
                local is_slippery = false
 
                if def and def.walkable then