Skip to content

Commit

Permalink
Spoony: WoWPro.ZoneContinent().
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovicus-Maior committed Apr 24, 2024
1 parent 72b4dc6 commit 2a9c398
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions WoWPro/WoWPro_Zones.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,28 @@ function WoWPro:ValidZone(zone, quiet)
return nil, nil
end

function WoWPro.ZoneContinent(zoneID)
repeat
WoWPro:dbp("ZoneContinent(%d): Studying %q %d", zoneID, WoWPro.MapInfo[zoneID].name, WoWPro.MapInfo[zoneID].mapType)
if WoWPro.MapInfo[zoneID].mapType == _G.Enum.UIMapType.Continent then
-- WoWPro:dbp("ZoneContinent(%d): Found Continent", zoneID)
return WoWPro.MapInfo[zoneID].name, zoneID
elseif (WoWPro.MapInfo[zoneID].mapType == _G.Enum.UIMapType.World) or (WoWPro.MapInfo[zoneID].mapType == _G.Enum.UIMapType.Cosmic) then
-- WoWPro:dbp("ZoneContinent(%d): No Continent", zoneID)
-- We are lost!
return nil, nil
elseif WoWPro.MapInfo[zoneID].parent_map then
-- WoWPro:dbp("ZoneContinent(%d): Moving up tree to %d", zoneID, WoWPro.MapInfo[zoneID].parent_map)
zoneID = WoWPro.MapInfo[zoneID].parent_map
else
WoWPro:dbp("ZoneContinent(%d): Orphan", zoneID)
zoneID = 0
end
until zoneID == 0
return nil, nil
end


function WoWPro:IsInstanceZone(zone)
local nzone, mapID = WoWPro:ValidZone(zone)
if not nzone then
Expand Down

0 comments on commit 2a9c398

Please sign in to comment.