Quantcast
WoWInterface - View Single Post - Get current continent name or id?
View Single Post
07-20-18, 06:32 AM   #4
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 778
For one of my addons I use this function. It does not return the "old" values. So you need to find the right values for your addon.
Lua Code:
  1. local function getContinent()
  2.     local mapID = C_Map.GetBestMapForUnit("player")
  3.     if(mapID) then
  4.         local info = C_Map.GetMapInfo(mapID)
  5.         if(info) then
  6.             while(info['mapType'] and info['mapType'] > 2) do
  7.                 info = C_Map.GetMapInfo(info['parentMapID'])
  8.             end
  9.             if(info['mapType'] == 2) then
  10.                 return info['mapID']
  11.             end
  12.         end
  13.     end
  14. end
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote