Originally Posted by SDPhantom
This is how I would implement a fallback list using multiple ors.
Lua Code:
watchedFactionID = watchedFactionID or (inInstance and hasDungeonTabard and tabardID) or (lookUpSubZones and (citySubZonesAndFactions[subZone] or subZonesAndFactions[subZone])) or (inInstance and instancesAndFactions[whichInstanceID]) or (not lookUpSubZones and isWoDZone and bodyguardRepID) or (not inInstance and zonesAndFactions[uiMapID]) or self.fallbackRepID
Note parenthesis are highly suggested to direct which order you want logic operations to run as mixing and/ or operations can lead to unpredictable results.
|
This solution worked! I tested in Un'Goro Crater, which has no rep assigned and the addon watched my fallback. Then I went into the Stockades dungeon with the Ironforge faction tabard, which worked. And finally, I flew back and forth between the main section of Valdrakken and the Artisan's section and that worked.
Thank you so much!