Fix item entity's collision with nodeboxes

master
jordan4ibanez 2012-12-15 15:32:17 -05:00
parent 9786202b08
commit aa46e5c5e7
1 changed files with 3 additions and 2 deletions

View File

@ -84,8 +84,9 @@ minetest.register_entity("__builtin:item", {
local p = self.object:getpos() local p = self.object:getpos()
p.y = p.y - 0.3 p.y = p.y - 0.3
local nn = minetest.env:get_node(p).name local nn = minetest.env:get_node(p).name
-- If node is not registered or node is walkably solid -- If node is not registered or node is walkably solid and resting on nodebox
if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable then 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 if self.physical_state then
self.object:setvelocity({x=0,y=0,z=0}) self.object:setvelocity({x=0,y=0,z=0})
self.object:setacceleration({x=0, y=0, z=0}) self.object:setacceleration({x=0, y=0, z=0})