From 5e4d6468a3110d8879e80e51490c0717ce64d75c Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 21 Dec 2016 07:10:32 +0000 Subject: 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. --- builtin/game/falling.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3