forked from mtcontrib/pipeworks
Prevent another crash if minetest crashes during startup
This commit is contained in:
parent
05ca3e4f4f
commit
6ad2c9f568
|
@ -46,6 +46,11 @@ local function read_entities()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function write_entities()
|
local function write_entities()
|
||||||
|
if not luaentity.entities then
|
||||||
|
-- This can happen if crashing on startup, causing another error that
|
||||||
|
-- masks the original one. Return gracefully in that case instead.
|
||||||
|
return
|
||||||
|
end
|
||||||
for _, entity in pairs(luaentity.entities) do
|
for _, entity in pairs(luaentity.entities) do
|
||||||
setmetatable(entity, nil)
|
setmetatable(entity, nil)
|
||||||
for _, attached in pairs(entity._attached_entities) do
|
for _, attached in pairs(entity._attached_entities) do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user