From: paramat Date: Wed, 21 Dec 2016 07:10:32 +0000 (+0000) Subject: Builtin/../falling.lua: Avoid crash when object pos over limit X-Git-Tag: 0.4.15~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5e4d6468a3110d8879e80e51490c0717ce64d75c;p=oweals%2Fminetest.git Builtin/../falling.lua: Avoid crash when object pos over limit If the object pos is over limit, 'add entity' will not add an entity, causing 'obj' to be nil. --- diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 8b88b68d8..4696ce481 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -113,7 +113,9 @@ core.register_entity(":__builtin:falling_node", { local function spawn_falling_node(p, node) local obj = core.add_entity(p, "__builtin:falling_node") - obj:get_luaentity():set_node(node) + if obj then + obj:get_luaentity():set_node(node) + end end local function drop_attached_node(p)