Originally Posted by p3lim
This method is safe:
Lua Code:
local oldAreaID = GetCurrentMapAreaID() SetMapToCurrentZone() -- store the current area ID local areaID = GetCurrentMapAreaID() SetMapByID(oldAreaID) -- do things
|
No it isn't, you don't take into account the previous map level. Also, changing the map resets its zoom (if you use the scroll wheel on the world map).
This would also set the map to the wrong zone if you're currently inside of a microdungeon.
There are other things to consider when changing the map, like how extremely cpu intensive addons like Routes and Gatherer would react.
The only safeish method for actively changing the current map is to unregister WORLD_MAP_UPDATE from every frame that's watching it, do your thing and swap the map back to what it previously was, then re-register the event to those frames.
I don't recommend anyone do that unless they fully comprehend how the map works.