1
0
miroir de https://github.com/mt-mods/pipeworks.git synchronisé 2025-07-12 21:30:37 +02:00

Prevent another crash if minetest crashes during startup

Cette révision appartient à :
Pedro Gimeno
2019-06-06 23:13:53 +02:00
Parent 05ca3e4f4f
révision 6ad2c9f568

Voir le fichier

@ -46,6 +46,11 @@ local function read_entities()
end
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
setmetatable(entity, nil)
for _, attached in pairs(entity._attached_entities) do