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.
This commit is contained in:
parent
4e839d3434
commit
4471a7f75a
@ -113,8 +113,10 @@ core.register_entity(":__builtin:falling_node", {
|
|||||||
|
|
||||||
local function spawn_falling_node(p, node)
|
local function spawn_falling_node(p, node)
|
||||||
local obj = core.add_entity(p, "__builtin:falling_node")
|
local obj = core.add_entity(p, "__builtin:falling_node")
|
||||||
|
if obj then
|
||||||
obj:get_luaentity():set_node(node)
|
obj:get_luaentity():set_node(node)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function drop_attached_node(p)
|
local function drop_attached_node(p)
|
||||||
local nn = core.get_node(p).name
|
local nn = core.get_node(p).name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user