Quantcast WoWInterface - View Single Post - Map changes.
Thread: Map changes.
View Single Post
05-10-18, 02:41 AM   #6
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 175
Originally Posted by Nimhfree View Post
To get the current continent the player is in you can use the following:
Code:
local currentMapId, TOP_MOST = C_Map.GetBestMapForUnit('player'), true
local currentContinentInfo = MapUtil.GetMapParentInfo(currentMapId, Enum.UIMapType.Continent, TOP_MOST)
That info contains both the mapID and name.
Took me a few days but works like a charm
Thank you Nimhfree

Lua Code:
  1. local currentMapId, TOP_MOST = C_Map.GetBestMapForUnit('player'), true
  2. local currentContinentInfo = MapUtil.GetMapParentInfo(currentMapId, Enum.UIMapType.Continent, TOP_MOST)
  3. zone.continent = currentContinentInfo.name
__________________
Better to fail then never have tried at all.
  Reply With Quote