View Single Post
09-25-23, 02:01 AM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
More debugging. watchedFactionID is nil with the following code, at least for WoD zones and now subzones too, as "Dwarven District" in Stormwind stopped working. It is supposed to be 47 for Ironforge. It is 72 when I'm in other parts of Stormwind and 2510 in Valdrakken, so the major zones are working.

I also tested the addon settings and disabled Lunarfall (the Alliance Garrison) checking for a bodyguard, and suddenly the bar went from blank to Stormwind. This tells me something about isWoDZone and/or bodyguardRepID, and that I'm not handling one or both correctly. I'm not seeing the logic bomb.

As fast as I am getting answers, I am getting more confused about WoD and subzones. Besides anyone being helpful with debugging, I would love to learn why it isn't working, not just a fix.
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
  16. watchedFactionID = (watchedFactionID == nil and zonesAndFactions[uiMapID]) or db.defaultRepID
  17.  
  18. self:Print("DEBUG: watchedFactionID:", watchedFactionID)
  Reply With Quote