Map API question to help fix old addon
Trying to get an old addon (Equipped Forager) that worked only in Pandaria after the Map API changes in BFA. The offending line of code is
if GetCurrentMapContinent() == 6 then
"6" corresponded to Pandaria. AFAIK the new ID is "862," but GetCurrentMapContinent is no more.
The new APi seems to be still in development, and I could spend a few trying to plug things in and out, but /dumping all the new Gets returns nil in game so I am asking here first before i dive further in.
Does anyone have simple replacement for the line above? I have tried to look through other addons on Curse to see how others may have done this to no avail.
The addon works fine if I comment out the line above, and the "end." But it absolutely has to be manually disabled when not in Pandaria. Which is a PITA.
Edit: found it
local map = C_Map.GetMapInfo(C_Map.GetBestMapForUnit("player"))
local parent = C_Map.GetMapInfo(map.parentMapID)
if parent.name == "Pandaria" then
Last edited by Machinelf : 08-08-18 at 05:55 PM.
|