aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjordan4ibanez <jordan4ibanez@gmail.com>2012-12-15 15:32:17 -0500
committerjordan4ibanez <jordan4ibanez@gmail.com>2012-12-15 15:32:17 -0500
commitaa46e5c5e7285a8ac5c9e096a55c3fa02b90280e (patch)
tree2b473995a14008c4127c14339c045e7f89a49834
parent9786202b089622dceacb9deb678e6d6938a24719 (diff)
downloadminetest-aa46e5c5e7285a8ac5c9e096a55c3fa02b90280e.tar.gz
minetest-aa46e5c5e7285a8ac5c9e096a55c3fa02b90280e.tar.bz2
minetest-aa46e5c5e7285a8ac5c9e096a55c3fa02b90280e.zip
Fix item entity's collision with nodeboxes
-rw-r--r--builtin/item_entity.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/item_entity.lua b/builtin/item_entity.lua
index 2b12764f1..46415e538 100644
--- a/builtin/item_entity.lua
+++ b/builtin/item_entity.lua
@@ -84,8 +84,9 @@ minetest.register_entity("__builtin:item", {
local p = self.object:getpos()
p.y = p.y - 0.3
local nn = minetest.env:get_node(p).name
- -- If node is not registered or node is walkably solid
- if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable then
+ -- If node is not registered or node is walkably solid and resting on nodebox
+ local v = self.object:getvelocity()
+ if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then
if self.physical_state then
self.object:setvelocity({x=0,y=0,z=0})
self.object:setacceleration({x=0, y=0, z=0})