Pet container rewritten

This commit is contained in:
Tercio Jose
2024-06-14 18:30:20 -03:00
committed by andrew6180
parent 85fff228df
commit f6c59381ab
25 changed files with 784 additions and 469 deletions
+11 -11
View File
@@ -136,17 +136,18 @@ function Details222.LoadSavedVariables.CombatSegments()
Details.tabela_historico = Details.historico:CreateNewSegmentDatabase()
Details.tabela_overall = Details.combate:NovaTabela()
Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall)
Details.tabela_pets = Details.container_pets:NovoContainer()
Details:UpdatePetCache()
Details222.PetContainer.Reset()
if (currentCharacterData.tabela_pets) then
Details:Destroy(currentCharacterData.tabela_pets) --saved pet data
currentCharacterData.tabela_pets = nil
if (currentCharacterData.saved_pet_cache) then
Details:Destroy(currentCharacterData.saved_pet_cache) --saved pet data
currentCharacterData.saved_pet_cache = nil
end
if (currentCharacterData.tabela_overall) then --saved overall data
Details:Destroy(currentCharacterData.tabela_overall)
currentCharacterData.tabela_overall = nil
end
if (currentCharacterData.tabela_historico) then
Details:Destroy(currentCharacterData.tabela_historico)
currentCharacterData.tabela_historico = nil
@@ -156,12 +157,12 @@ function Details222.LoadSavedVariables.CombatSegments()
else
--pet owners cache saved on logout
do
Details.tabela_pets = Details.container_pets:NovoContainer()
if (currentCharacterData.tabela_pets) then
Details222.PetContainer.Reset()
if (currentCharacterData.saved_pet_cache) then
--pet ownership table only exists if the player logoff inside a raid or dungeon
Details.tabela_pets.pets = Details.CopyTable(currentCharacterData.tabela_pets)
Details:Destroy(currentCharacterData.tabela_pets)
currentCharacterData.tabela_pets = nil
Details222.PetContainer.SetPetData(currentCharacterData.saved_pet_cache)
Details:Destroy(currentCharacterData.saved_pet_cache)
currentCharacterData.saved_pet_cache = nil
end
end
@@ -194,7 +195,6 @@ function Details222.LoadSavedVariables.CombatSegments()
actorContainer.need_refresh = true
end
Details:UpdatePetCache()
Details:RestoreMetatables()
end
end