Browse Source

Prevent another crash if minetest crashes during startup

tags/2019-06-07-1
Pedro Gimeno 1 year ago
parent
commit
6ad2c9f568
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      luaentity.lua

+ 5
- 0
luaentity.lua View File

@@ -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


Loading…
Cancel
Save