Closed yoshimo closed 1 year ago
If it is above classic, it has the function call, but if it is DF , aka toc version above 10 the function has moved. The logic for that can be shorter and might not work this way. That's why we have a draft for this.
Yea, I understand that. It was purely the scope issue that I was concerned with.
You can do something like this, I think:
local _, _, _, friendName, _, _, _, _, _ = (GetFriendshipReputation or C_GossipInfo.GetFriendshipReputation)(reputationIndex)
But if you want to be clearer, then this would probably work:
local friendName, _
local _, _, _, tocversion = GetBuildInfo()
if tocversion >= 100000 then
_, _, _, friendName, _, _, _, _, _ = C_GossipInfo.GetFriendshipReputation(reputationIndex)
else
_, _, _, friendName, _, _, _, _, _ = GetFriendshipReputation(reputationIndex)
end
I am implementing something along the lines of what Malivil mentions (using both versions of the API and let the system call what is actually has).
already solved
Not sure about how you have this fixed, honestly. The
if
means the variable is defined in two scopes, but is it actually available outside of that where it's used?The other errors I was getting with Wholly/Grail were due to it not knowing what the DF expansion is (which makes sense). As a temporary workaround I just subtracted 1 from
expansionIndex
in_HighestSupportedExpansion
to effectively ignore DF, but the right fix would be to at least stub out all the new stuff (new map, race, class, etc.)