Yeah you are right. What i am actually doing is:
I do the
reverse check to test if the achievement has a valid category. The ID at the end from the category data has to match the achievement ID so i know that it is correct. Because of the valid category, i can tell that i have a solo or a first achievement of a line (the event doesn't fire for completed achievements of progression lines).
Lua Code:
-- Check if the category of an achievement is valid (reverse check)
function AchievementInfo.checkForValidCategory(achId)
local categoryTopLevelIndex, categoryIndex, achievementIndex = GetCategoryInfoFromAchievementId(achId)
local reverseAchievementId = GetAchievementId(categoryTopLevelIndex, categoryIndex, achievementIndex)
if achId == reverseAchievementId then
return true
end
return false
end
Is the category invalid, i know i am on a higher achievement in the line. Has this achievement a previousId value of 0 i can ignore it because it is to high. Has it a value of ~= 0 i can recursively check the previous achievement for the category