coa.2: guard CoA data shapes (custom classes, comm-seeded records, ungeared chars)
release / release (push) Successful in 5s
release / release (push) Successful in 5s
Fixes login/UI crashes on Vol'jin - CoA Beta: - DataStore_Inventory: GetAverageItemLevel returns 0 not nil (Altoholic sort + AccountSummary iLvl format); guard login AIL broadcast and 0/0 average. - DataStore_Pets: GetNumPets returns 0 for unscanned companion table instead of assert-crashing TabCharacters. - DataStore_Characters: GetColoredCharacterName tolerates nil name. - Altoholic/Characters.lua: GetLineType returns nil for stale line id. Stamp -coa.2 + X-Edited-By: Exiles on touched addons; README CoA changelog.
This commit is contained in:
@@ -88,7 +88,7 @@ local function GetAIL(alts)
|
||||
local out = {}
|
||||
|
||||
local character = DataStore:GetCharacter() -- this character
|
||||
local ail = DataStore:GetAverageItemLevel(character)
|
||||
local ail = DataStore:GetAverageItemLevel(character) or 0 -- CoA: guard nil so the login AIL broadcast can't crash (mirrors the alt loop below)
|
||||
table.insert(out, format("%s:%d", UnitName("player"), ail))
|
||||
|
||||
if strlen(alts) > 0 then
|
||||
@@ -162,7 +162,7 @@ function ScanInventory()
|
||||
end
|
||||
end
|
||||
|
||||
addon.ThisCharacter.averageItemLvl = totalItemLevel / itemCount
|
||||
addon.ThisCharacter.averageItemLvl = (itemCount > 0) and (totalItemLevel / itemCount) or 0 -- CoA: ungeared char => itemCount 0; avoid 0/0 nan
|
||||
addon.ThisCharacter.lastUpdate = time()
|
||||
end
|
||||
|
||||
@@ -202,7 +202,7 @@ local function _GetInventoryItemCount(character, searchedID)
|
||||
end
|
||||
|
||||
local function _GetAverageItemLevel(character)
|
||||
return character.averageItemLvl
|
||||
return character.averageItemLvl or 0 -- CoA: chars known only via guild comm / not yet scanned have no iLvl; callers do arithmetic on it (Altoholic sort, AccountSummary format)
|
||||
end
|
||||
|
||||
local sentRequests -- recently sent requests
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
## Title: DataStore_Inventory
|
||||
## Notes: Stores information about character inventory
|
||||
## Author: Thaoky (EU-Marécages de Zangar)
|
||||
## Version: 3.3.002
|
||||
## X-Edited-By: Exiles (Sub-Net)
|
||||
## Version: 3.3.002-coa.2
|
||||
## Dependencies: DataStore
|
||||
## OptionalDeps: Ace3
|
||||
## SavedVariables: DataStore_InventoryDB
|
||||
|
||||
Reference in New Issue
Block a user