I figured it out by updating the pre-assigned zone and subzone lists, which were using whatever was assigned during initial login, which is probably either nil. I'll clean up the code, but here are the fixed lines.
Lua Code:
-- Sholazar Basin has three possible zone factions; some DF subzones have two; retun factionID based on player's quest progress
function RepByZone:GetMultiRepIDsForZones()
-- Sholazar Basin
local newSholazarRepID
local frenzyHeartStanding = select(3, GetFactionInfoByID(1104))
local oraclesStanding = select(3, GetFactionInfoByID(1105))
if frenzyHeartStanding <= 3 then
newSholazarRepID = 1105 -- Frenzyheart hated, return Oracles
elseif oraclesStanding <= 3 then
newSholazarRepID = 1104 -- Oracles hated, return Frenzyheart
elseif (frenzyHeartStanding == 0) or (oraclesStanding == 0) then
newSholazarRepID = db.watchedRepID or self.racialRepID
end
if newSholazarRepID ~= self.sholazarRepID then
self.sholazarRepID = newSholazarRepID
-- self:SwitchedZones()
end
-- Wrathion or Sabellian in Dragonflight
local newDragonFlightRepID = 2510 -- start with Valdrakken Accord
self.dragonflightRepID = 2510 -- start with Valdrakken Accord
local wrathionFriendshipInfo = C_GossipInfo.GetFriendshipReputation(2517)
local sabellionFriendshipInfo = C_GossipInfo.GetFriendshipReputation(2518)
local wrathionRankInfo = C_GossipInfo.GetFriendshipReputationRanks(2517)
local sabellionRankInfo = C_GossipInfo.GetFriendshipReputationRanks(2518)
local wrathionMaxRep = wrathionFriendshipInfo and wrathionFriendshipInfo.maxRep or 0 -- use 0 instead of possible nil
local sabellionMaxRep = sabellionFriendshipInfo and sabellionFriendshipInfo.maxRep or 0 -- use 0 instead of possible nil
local wrathionNextThreshold = wrathionFriendshipInfo and wrathionFriendshipInfo.nextThreshold or 0 -- use 0 instead of possible nil
local sabellionNextThreshold = sabellionFriendshipInfo and sabellionFriendshipInfo.nextThreshold or 0 -- use 0 instead of possible nil
local wrathionCurrentRepAmount = wrathionMaxRep % wrathionNextThreshold
local sabellionCurrentRepAmount = sabellionMaxRep % sabellionNextThreshold
if (wrathionRankInfo and wrathionRankInfo.currentLevel) > (sabellionRankInfo and sabellionRankInfo.currentLevel) then
newDragonFlightRepID = 2517 -- Wrathion is higher
self:Print("Wrathion rank is higher, newDragonFlightRepID is", newDragonFlightRepID)
elseif (sabellionRankInfo and sabellionRankInfo.currentLevel) > (wrathionRankInfo and wrathionRankInfo.currentLevel) then
newDragonFlightRepID = 2518 -- Sabellian is higher
self:Print("Sabellian rank is higher, newDragonFlightRepID is", newDragonFlightRepID)
elseif (wrathionRankInfo and wrathionRankInfo.currentLevel) == (sabellionRankInfo and sabellionRankInfo.currentLevel) then
-- they are the same rank or the factions are unknown, verify
if wrathionCurrentRepAmount > sabellionCurrentRepAmount then
newDragonFlightRepID = 2517 -- Wrathion is higher
self:Print("Dragon ranks are the same, Wrathion progress is higher, newDragonFlightRepID is", newDragonFlightRepID)
elseif sabellionCurrentRepAmount > wrathionCurrentRepAmount then
newDragonFlightRepID = 2518 -- Sabellian is higher
self:Print("Dragon ranks are the same, Sabellian progress is higher, newDragonFlightRepID is", newDragonFlightRepID)
end
end
self:Print("newDragonFlightRepID is", newDragonFlightRepID)
if newDragonFlightRepID ~= self.dragonflightRepID then
self.dragonflightRepID = newDragonFlightRepID
self:Print("self.dragonflightRepID is", self.dragonflightRepID)
-- self:SwitchedZones()
end
-- update both zones and subzones
zonesAndFactions = self:ZoneAndFactionList()
subZonesAndFactions = self:SubZonesAndFactions()
self:SwitchedZones()
end