View Single Post
09-25-23, 02:53 AM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
I solved it, yet even though I solved the issues, I can't explain why this was necessary or what my prior method was doing wrong.
Lua Code:
  1. -- Process subzones
  2. if db.watchSubZones then
  3.     -- Battlegrounds and warfronts are the only instances with subzones
  4.     if inInstance and instanceType ~= "pvp" then return end
  5.  
  6.     -- Don't loop through subzones if the player is watching a bodyguard rep
  7.     if isWoDZone and bodyguardRepID then
  8.         watchedFactionID = bodyguardRepID
  9.     else
  10.         -- Get our subzone data
  11.         watchedFactionID = CitySubZonesAndFactions[subZone] or subZonesAndFactions[subZone]
  12.     end
  13. end
  14.  
  15. -- Get world zone data or the character's default watched faction. For some unknown reason, watchedFactionID loses data from bodyguards and instances at this stage in the code, refresh
  16. if watchedFactionID == nil then
  17.     if isWoDZone and bodyguardRepID then
  18.         watchedFactionID = bodyguardRepID
  19.     elseif inInstance and hasDungeonTabard then
  20.         watchedFactionID = tabardID
  21.     elseif inInstance then
  22.         watchedFactionID = instancesAndFactions[whichInstanceID] or db.defaultRepID
  23.     else
  24.         watchedFactionID = zonesAndFactions[uiMapID] or db.defaultRepID
  25.     end
  26. end
  Reply With Quote