Originally Posted by Haleth
Feels like there are a gazillion ways to get the amount of people/difficulty of an instance by now, and they just keep changing it
|
My main annoyance is that they've let the array of difficulties have gaps in 5.3 (and 5.4 if it goes live like this)
Which means I have to either hardcode them and update each time something is added or loop to an arbitrary higher number and skip non-implemented ids in hopes that they won't exceed it.
Previously it was possible to make self-maintaining code with (as an example)
Code:
local diffs,id = {},1
diffs[0]={_G.NONE,_G.SOLO,false,false}
local name,groupType,isHeroic,isChallengeMode,toggleDifficultyID=GetDifficultyInfo(id)
while (name and name~="") do
diffs[id]={name,groupType,isHeroic,isChallengeMode,toggleDifficultyID}
id=id+1
name,groupType,isHeroic,isChallengeMode,toggleDifficultyID=GetDifficultyInfo(id)
end
This now fails because there's a 'hole' in the array at id 10 so it doesn't grab scenario/hc scenario (and looks like another hole at 13 in 5.4)