Skip to content
Snippets Groups Projects
Commit aa46e5c5 authored by jordan4ibanez's avatar jordan4ibanez
Browse files

Fix item entity's collision with nodeboxes

parent 9786202b
No related branches found
No related tags found
No related merge requests found
...@@ -84,8 +84,9 @@ minetest.register_entity("__builtin:item", { ...@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment