View Single Post
08/09/17, 08:31 AM   #9
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by ZOS_ChipHilseberg View Post
Looks like we were able to reproduce it.
Thanks @Chip.

I already took a look into the issue and may save you time.
The problem is distributed across two source files. At the end the code for the summary and the code for the sub-category are calling the same function: self:GetCategoryInfo(categoryIndex)
To get the correct values for what you call yourself a faked sub-category=General, is to substract all real sub-category values from the summary values.
Like this:
Lua Code:
  1. do
  2.     local orgGetCategoryInfoFromData = ACHIEVEMENTS.GetCategoryInfoFromData
  3.     function ACHIEVEMENTS.GetCategoryInfoFromData(self, data, parentData)
  4.         if not data.isFakedSubcategory and parentData then
  5.             return orgGetCategoryInfoFromData(self, data, parentData)
  6.         else
  7.             local numSubCategories, numAchievements, earnedPoints, totalPoints, hidesPoints = select(2, self:GetCategoryInfo(data.categoryIndex))
  8.             if parentData then
  9.                 for index = 1, numSubCategories do
  10.                     local subEarned, subTotal = select(3, self:GetSubCategoryInfo(parentData.categoryIndex, index))
  11.                     earnedPoints, totalPoints = earnedPoints - subEarned, totalPoints - subTotal
  12.                 end
  13.             end
  14.             return numAchievements, earnedPoints, totalPoints, hidesPoints
  15.         end
  16.     end
  17. end