smaitch / Grail

World of Warcraft addon to provide a database of quest information.
31 stars 19 forks source link

DF-Changes #316

Closed yoshimo closed 1 year ago

Malivil commented 1 year ago

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.)

yoshimo commented 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.

Malivil commented 1 year ago

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
smaitch commented 1 year ago

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).

yoshimo commented 1 year ago

already solved