09-24-23, 03:03 PM | #1 |
Code isn't functioning in WoD zones
RepByZone's code should either set the watched faction to the combat ally/bodyguard or Stormwind/Orgrimmar if the player has no bodyguard.
With testing, I know that the variable bodyguardRepID contains data for the character with a bodyguard, and nil for characters without a bodyguard. However, the print statement on line 627 of Core-Retail.lua isn't doing anything when I am in my garrison or any WoD zone. Nothing gets printed. The entire line doesn't fire, and I don't know why. It fires for every other location I've tested, just not any WoD zones. Attached is the full zip, which contains non-retail files. Those are working, although I'll be streamlining them later. But the non-retail files aren't the issue. I'd appreciate any bright ideas or insight into why WoD zones are different and what is (not) going on when I go to them. Thank you. EDIT: not only is line 627 not firing in WoD zones, the variable watchedFactionID is not a number, so the watched rep bar gets cleared, regardless of whether having a bodyguard or not. The watched faction isn't even Stormwind or Orgrimmar. Last edited by myrroddin : 09-24-23 at 03:15 PM. Reason: More debug testing information |
|
![]() |
09-25-23, 12:09 AM | #2 |
Okay, this is bizzare; I was wrong: it isn't WoD zones, it is the final check to assign world zone data. No matter if I use:
Code:
if type(watchedFactionID) ~= "number" then ... Code:
if not watchedFactionID then ... Here is my updated function SwitchedZones() with the faulty if statement on line 82 below. Lua Code:
|
|
![]() |
09-25-23, 02:01 AM | #3 |
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:
|
|
![]() |
09-25-23, 02:53 AM | #4 |
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:
|
|
![]() |
WoWInterface » Developer Discussions » Lua/XML Help » Code isn't functioning in WoD zones |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|