Originally Posted by ircdirk
|
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.