WoWInterface - View Single Post - Detecting World PvP Zones
View Single Post
06-16-15, 01:53 PM   #9
A Pyroguard Emberseer
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,704
Originally Posted by Banknorris View Post
I try to avoid to use SetMapToCurrentZone() as much as I can (so far I could totally avoid it) because it will interfere with the user watching another map.
This method is safe:

Lua Code:
  1. local oldAreaID = GetCurrentMapAreaID()
  2. SetMapToCurrentZone()
  4. -- store the current area ID
  5. local areaID = GetCurrentMapAreaID()
  7. SetMapByID(oldAreaID)
  9. -- do things
  Reply With Quote