diff options
author | paramat <paramat@users.noreply.github.com> | 2018-02-06 00:55:35 +0000 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-06-03 17:32:00 +0200 |
commit | 529f00a2403cdd185b1eb5902de8947d03bb3413 (patch) | |
tree | 4597b20569d24004008c31da496d77c2ec0dc2f3 /builtin/game | |
parent | 77250300676bc08cff4e687df0b6ac86ea35a6e4 (diff) | |
download | minetest-529f00a2403cdd185b1eb5902de8947d03bb3413.tar.gz minetest-529f00a2403cdd185b1eb5902de8947d03bb3413.tar.bz2 minetest-529f00a2403cdd185b1eb5902de8947d03bb3413.zip |
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.
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/falling.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 1ac4f7081..991962cc3 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -60,8 +60,13 @@ core.register_entity(":__builtin:falling_node", { local pos = self.object:getpos() -- Position of bottom center point 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) + -- 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] if bcn and (not bcd or bcd.walkable or |