Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-08-18, 03:21 PM   #1
Machinelf
A Murloc Raider
Join Date: Oct 2011
Posts: 4
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.
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Map API question to help fix old addon


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off