diff --git a/game/engines/default/engine/Level.lua b/game/engines/default/engine/Level.lua index b04348020e9d1f5d4cc2ada6dc205bad192433bf..231bc87e17478eb45bdfb07d4837549c31f04fba 100644 --- a/game/engines/default/engine/Level.lua +++ b/game/engines/default/engine/Level.lua @@ -74,7 +74,7 @@ function _M:addEntity(e, after, no_error) return end - if self.entities[e.uid] then if no_error then return else error("Entity "..e.uid.."("..e.name..") already present on the level") end end + if self.entities[e.uid] then if no_error then return else error("Entity "..e.uid.."("..(e.name or "???")..") already present on the level") end end self.entities[e.uid] = e if e.addEntityOrder then after = e:addEntityOrder(level) end if not after or not self:hasEntity(after) then @@ -107,7 +107,7 @@ function _M:removeEntity(e, force) return end - if not self.entities[e.uid] and not force then error("Entity "..e.uid.."("..e.name..") not present on the level") end + if not self.entities[e.uid] and not force then error("Entity "..e.uid.."("..(e.name or "???")..") not present on the level") end self.entities[e.uid] = nil for i = 1, #self.e_array do if self.e_array[i] == e then diff --git a/game/engines/default/engine/interface/PlayerDumpJSON.lua b/game/engines/default/engine/interface/PlayerDumpJSON.lua index f7c5b9c0277efe172112a76672a5d74be4467d4e..712b84dfd85320fe2ca4a95cd1eff226cce437c5 100644 --- a/game/engines/default/engine/interface/PlayerDumpJSON.lua +++ b/game/engines/default/engine/interface/PlayerDumpJSON.lua @@ -58,7 +58,7 @@ function _M:saveUUID(do_charball) if not data or not title then return end profile:registerSaveChardump(game.__mod_info.short_name, self.__te4_uuid, title, tags, core.zlib.compress(data)) - if do_charball then + if do_charball then pcall(function() savefile_pipe:push(do_charball.name, "entity", do_charball, "engine.CharacterBallSave", function(save) f = fs.open("/charballs/"..save:nameSaveEntity(do_charball), "r") if f then @@ -73,7 +73,7 @@ function _M:saveUUID(do_charball) profile:registerSaveCharball(game.__mod_info.short_name, self.__te4_uuid, table.concat(data)) end end) - end + end) end end --- Override this method to define dump sections diff --git a/game/modules/tome/class/interface/PartyIngredients.lua b/game/modules/tome/class/interface/PartyIngredients.lua index 196ce50124aba45e17fb3643e6518041f279db2b..8c0853569d590a21a0d1c19b5f2d3fa264335b03 100644 --- a/game/modules/tome/class/interface/PartyIngredients.lua +++ b/game/modules/tome/class/interface/PartyIngredients.lua @@ -65,6 +65,7 @@ function _M:getIngredient(id) end function _M:collectIngredient(id, nb, silent) + if not self.ingredients then return end if not self.__ingredients_def[id] then return end local d = self.__ingredients_def[id] nb = nb or 1 @@ -84,6 +85,7 @@ function _M:collectIngredient(id, nb, silent) end function _M:hasIngredient(id, nb) + if not self.ingredients then return end if not self.__ingredients_def[id] then return false end local d = self.__ingredients_def[id] nb = nb or 1 @@ -95,6 +97,7 @@ function _M:hasIngredient(id, nb) end function _M:useIngredient(id, nb) + if not self.ingredients then return end if not self.__ingredients_def[id] then return false end local d = self.__ingredients_def[id] nb = nb or 1