View Single Post
03-23-24, 08:44 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
This is how I would implement a fallback list using multiple ors.
Lua Code:
  1. watchedFactionID = watchedFactionID
  2.     or (inInstance and hasDungeonTabard and tabardID)
  3.     or (lookUpSubZones and (citySubZonesAndFactions[subZone] or subZonesAndFactions[subZone]))
  4.     or (inInstance and instancesAndFactions[whichInstanceID])
  5.     or (not lookUpSubZones and isWoDZone and bodyguardRepID)
  6.     or (not inInstance and zonesAndFactions[uiMapID])
  7.     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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote