summaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2018-02-10 04:55:40 +0000
committerparamat <mat.gregory@virginmedia.com>2018-02-13 03:48:34 +0000
commit1156088db740fed69051201fb943feaff3b4f678 (patch)
tree486dbe1283c2a14ce47f7da0088c16c69a0f2248 /builtin/game
parent737f0b447380597ffa1e4c39beeab847e96ed6b2 (diff)
downloadminetest-1156088db740fed69051201fb943feaff3b4f678.tar.gz
minetest-1156088db740fed69051201fb943feaff3b4f678.tar.bz2
minetest-1156088db740fed69051201fb943feaff3b4f678.zip
Item entity: Delete in 'ignore' nodes
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/item_entity.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/builtin/game/item_entity.lua b/builtin/game/item_entity.lua
index a18467764..4dca6117d 100644
--- a/builtin/game/item_entity.lua
+++ b/builtin/game/item_entity.lua
@@ -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