I am reworking the code chunk in RepByZone that handles getting either Wrathion's or Sabellion's factionID whenever the player's reputation changes. Instead of returning either dragon's factionID, the code is returning the backup of Valdrakken Accord.
What should be happening:
- Check the current friendship ranks and return the factionID of the highest rank.
- If the ranks are equal, check the progress to the next rank.
- If both factions are dead equal or the player hasn't discovered the factionIDs, then return Valdrakken Accord.
I have tested on my main, who is 2 of 6 with Wrathion and 1 of 6 with Sabellion. Each time I visit the Obsidian Throne, RBZ is not switching. The addon is still displaying Valdrakken Accord, and I can't spot the error. I've double-checked the areaID, and the factionIDs, done a few /dump tests, and have run out of ideas.
Here is my latest commit on GitHub:
https://github.com/Myrroddin/repbyzone and the buggy code is on lines 444-475 of Core-Retail.lua.