View Single Post
08-24-15, 08:53 AM   #11
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 63
Originally Posted by ircdirk View Post
I was searching for it but nowhere is written that this funcition returns something, see here http://wowprogramming.com/docs/api/SetMapByID or here http://wowwiki.wikia.com/wiki/API_SetMapByID but ofcourse this can be outdated info...
Just test it ingame, any valid map ID will return true, any invalid id will give you nil or false.
Its a good way to test if a given map id is actually valid.

Most of these docs are derived from ingame tests, so it should just be augmented.

Regarding hooking, as Nimhfree pointed out, that wouldn't be able to fullfill the same goal as the current solution (whatever that goal is).
However, I would argue that if an addon calls SetMapByID, it has a reason for that, and it shouldn't be blocked from doing so.

My guess is that its a performance optimization to stop other addons from redrawing the map while Carbonite is doing its thing.
However, there are better solutions than entirely blocking this. For example, when my addon switches the map around just to get info from the map API, it'll disable the WORLD_MAP_UPDATE event before, so that other addons would never know that I even called it - avoiding any extra load.

Last edited by Nevcairiel : 08-24-15 at 02:04 PM.
  Reply With Quote