mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 12:33:45 +01:00
Falling.lua: Delete falling node entities on contact with 'ignore'
Prevents falling node entities entering the ignore at a world edge and resting on unloaded nodes 16 nodes below, unreachable, undiggable and still being processed by 'on step' because they don't revert to nodes.
This commit is contained in:
parent
7725030067
commit
529f00a240
@ -60,8 +60,13 @@ core.register_entity(":__builtin:falling_node", {
|
|||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
-- Position of bottom center point
|
-- Position of bottom center point
|
||||||
local bcp = {x = pos.x, y = pos.y - 0.7, z = pos.z}
|
local bcp = {x = pos.x, y = pos.y - 0.7, z = pos.z}
|
||||||
-- Avoid bugs caused by an unloaded node below
|
-- 'bcn' is nil for unloaded nodes
|
||||||
local bcn = core.get_node_or_nil(bcp)
|
local bcn = core.get_node_or_nil(bcp)
|
||||||
|
-- Delete on contact with ignore at world edges
|
||||||
|
if bcn and bcn.name == "ignore" then
|
||||||
|
self.object:remove()
|
||||||
|
return
|
||||||
|
end
|
||||||
local bcd = bcn and core.registered_nodes[bcn.name]
|
local bcd = bcn and core.registered_nodes[bcn.name]
|
||||||
if bcn and
|
if bcn and
|
||||||
(not bcd or bcd.walkable or
|
(not bcd or bcd.walkable or
|
||||||
|
Loading…
Reference in New Issue
Block a user