mirror of
https://github.com/minetest/minetest.git
synced 2024-11-04 14:53:45 +01:00
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
ba52a34f94
commit
5e4d6468a3
@ -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")
|
||||
if obj then
|
||||
obj:get_luaentity():set_node(node)
|
||||
end
|
||||
end
|
||||
|
||||
local function drop_attached_node(p)
|
||||
|
Loading…
Reference in New Issue
Block a user