mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-09-07 22:06:48 +02:00
Fix crash if add_entity fails (#88)
This commit is contained in:
parent
d90c17edee
commit
e7cba4071b
@ -163,11 +163,15 @@ local entitydef_default = {
|
||||
if not is_active(entity_pos) then
|
||||
return
|
||||
end
|
||||
local ent = minetest.add_entity(entity_pos, entity.name):get_luaentity()
|
||||
local object = minetest.add_entity(entity_pos, entity.name)
|
||||
if not object then
|
||||
return
|
||||
end
|
||||
local ent = object:get_luaentity()
|
||||
ent:from_data(entity.data)
|
||||
ent.parent_id = self._id
|
||||
ent.attached_id = index
|
||||
entity.entity = ent.object
|
||||
entity.entity = object
|
||||
local master = self._attached_entities_master
|
||||
if master then
|
||||
self:_attach(index, master)
|
||||
|
Loading…
Reference in New Issue
Block a user