Quantcast
WoWInterface - View Single Post - Detecting World PvP Zones
View Single Post
06-16-15, 01:53 PM   #9
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,703
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()
  3.  
  4. -- store the current area ID
  5. local areaID = GetCurrentMapAreaID()
  6.  
  7. SetMapByID(oldAreaID)
  8.  
  9. -- do things
  Reply With Quote