Thread Tools Display Modes
11-17-14, 07:16 PM   #1
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Astrolabe bug?

I see change logs for various AddOns saying that they are switching to a different API in TomTom to work around a bug in Astrolabe. The API now being used starts on line 879 of TomTom.lua
Code:
function TomTom:AddMFWaypoint(m, f, x, y, opts)
My questions are:
  1. What is the nature of the bug in Astrolabe? What was the code supposed to do, and what is it doing instead?
  2. Where in Astrolabe's code is the bug found? Which API, Lua file, line number?
  3. Why does using TomTom's API bypass the bug?
  4. Does Esamynn know?
Thank you for any help.
  Reply With Quote
11-17-14, 11:43 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by myrroddin View Post
Where in Astrolabe's code is the bug found? Which API, Lua file, line number?
The bug is in TomTom's "AddZWaypoint" method, which is why addons are switching to its "AddMFWaypoint" method instead. The "Z" stands for zone, while "MF" stands for map and floor. AddZWaypoint takes a continent index and zone index, asks Astrolabe to translate those into a map and floor, and then calls AddMFWaypoint. Based on a quick look in Astrolabe, it looks like the bug is related to Astrolabe not having been updated (completely/properly/maybe at all) for the changes to GetMapContinents and GetMapZones in WoD.

Beyond that, though, I don't know anything, and don't feel any particular inclination to look into it any further. I'm not really sure why you'd use AddZWaypoint anyway... I'd guess all the addons affected were actually using AddWaypoint, which grabs the current continent and map and calls AddZWaypoint internally, so it's really just a lazy way of adding waypoints in the current zone without having to figure out which zone you're in. Not really a big deal to switch, though obviously it is a bug in Astrolabe that should probably get fixed.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-17-14, 11:59 PM   #3
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
I could change the default AddWaypoint() behaviour to use AddMFWaypoint() if you think that would help, as a short-term workaround?
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
11-18-14, 12:23 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, it won't help me, but it may help other addons that are still using Add(Z?)Waypoint, and the authors who have already switched to AddMFWaypoint might like to go back to doing things the lazier way.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
11-20-14, 01:52 AM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Sorry for the late reply. That makes sense, although I'm not sure why anyone would use zone instead of mapID and floor number. That just sounds like asking for trouble.
  Reply With Quote
11-20-14, 09:06 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Like I said, nobody actually looking up the continent and zone indices and calling AddZWaypoint; they were calling AddWaypoint to add a waypoint in the player's current zone without having to know anything about what zone that actually was.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Astrolabe bug?

Thread Tools
Display Modes

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