coa.17: comprehensive partial-data hardening + DataStore_Characters login scan + Skills strip cap
release / release (push) Successful in 5s
release / release (push) Successful in 5s
- Hardening sweep across DataStore_* (softened crash-asserts in Talents/Containers/Quests to graceful nil) + Altoholic frames (guarded remaining getter results). - DataStore_Characters: scan on login (was ghost-gated -> name/level/class never populated; the core 'no character data' cause). - Skills tab: cap inline professions at 6 (+N) so the strip stops overflowing into Cooking.
This commit is contained in:
@@ -678,25 +678,28 @@ local BagTypeStrings = {
|
||||
|
||||
local function _GetContainerInfo(character, containerID)
|
||||
local bag = _GetContainer(character, containerID)
|
||||
if type(bag) ~= "table" then return end -- CoA: unscanned bag on partial-data alt; was an index-nil crash
|
||||
return bag.icon, bag.link, bag.size, bag.freeslots, BagTypeStrings[bag.bagtype]
|
||||
end
|
||||
|
||||
local function _GetContainerSize(character, containerID)
|
||||
-- containerID can be number or string
|
||||
return character.Containers["Bag" .. containerID].size
|
||||
local bag = character.Containers["Bag" .. containerID] -- CoA: nil for unscanned bag on partial-data alt
|
||||
return bag and bag.size
|
||||
end
|
||||
|
||||
local function _GetSlotInfo(bag, slotID)
|
||||
assert(type(bag) == "table") -- this is the pointer to a bag table, obtained through addon:GetContainer()
|
||||
assert(type(slotID) == "number")
|
||||
-- CoA: partial-data alts can have an unscanned/nil bag pointer (GetContainer returns nil
|
||||
-- for a "BagN" the Containers module never scanned); return empties instead of asserting.
|
||||
if type(bag) ~= "table" or type(slotID) ~= "number" then return end
|
||||
|
||||
-- return itemID, itemLink, itemCount
|
||||
return bag.ids[slotID], bag.links[slotID], bag.counts[slotID] or 1
|
||||
return bag.ids and bag.ids[slotID], bag.links and bag.links[slotID], (bag.counts and bag.counts[slotID]) or 1
|
||||
end
|
||||
|
||||
local function _GetContainerCooldownInfo(bag, slotID)
|
||||
assert(type(bag) == "table") -- this is the pointer to a bag table, obtained through addon:GetContainer()
|
||||
assert(type(slotID) == "number")
|
||||
-- CoA: partial-data alts can have an unscanned/nil bag pointer; degrade to nil gracefully.
|
||||
if type(bag) ~= "table" or type(slotID) ~= "number" or type(bag.cooldowns) ~= "table" then return end
|
||||
|
||||
local cd = bag.cooldowns[slotID]
|
||||
if cd then
|
||||
@@ -868,7 +871,7 @@ end
|
||||
local function _GetGuildBankTabItemCount(guild, tabID, searchedID)
|
||||
local count = 0
|
||||
local container = guild.Tabs[tabID]
|
||||
|
||||
if type(container) ~= "table" or type(container.ids) ~= "table" then return count end -- CoA: unscanned guild bank tab; was a pairs(nil) crash on item tooltips
|
||||
for slotID, id in pairs(container.ids) do
|
||||
if (id == searchedID) then
|
||||
count = count + (container.counts[slotID] or 1)
|
||||
|
||||
Reference in New Issue
Block a user