Skip to content

Commit 1156088

Browse files
committedFeb 13, 2018
Item entity: Delete in 'ignore' nodes
1 parent 737f0b4 commit 1156088

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

Diff for: ‎builtin/game/item_entity.lua

+9-3
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,17 @@ core.register_entity(":__builtin:item", {
145145
y = pos.y + self.object:get_properties().collisionbox[2] - 0.05,
146146
z = pos.z
147147
})
148+
-- Delete in 'ignore' nodes
149+
if node and node.name == "ignore" then
150+
self.itemstring = ""
151+
self.object:remove()
152+
return
153+
end
154+
148155
local vel = self.object:getvelocity()
149156
local def = node and core.registered_nodes[node.name]
150-
-- Avoid entity falling into ignore nodes or unloaded areas
151-
local is_moving = node and node.name ~= "ignore" and
152-
((def and not def.walkable) or vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0)
157+
local is_moving = (def and not def.walkable) or
158+
vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0
153159
local is_slippery = false
154160

155161
if def and def.walkable then

0 commit comments

Comments
 (0)
Please sign in to comment.