Correcting the signature for the GetMapInfo API
We noticed that there was an error in the API for GetMapInfo:
Code:
* GetMapInfo(*luaindex* _index_) Code:
* GetMapInfo(*luaindex* _index_) A: Is anyone using the API? B: What would the community prefer in this situation? I can either correct it to be what it should be (potentially breaking any addon using the API) or I can deprecate the field (supporting it in the same broken way forever) and add a new corrected field on the end: Code:
* GetMapInfo(*luaindex* _index_) |
But that may just be my own preference. :D |
Wait but zoneId isn't always zoneIndex-1 (or +1), right? So does this mean up until now it hasn't been giving the right return value
|
Quote:
|
Searched my addons folder in total and "GetMapInfo" was used in several of the addons I know/use.
e.g. CraftStore which is commonly used and wide spread, Votans Improved Locations, Survey the World (also wide spread and used), What pledges at my alts (also wide spread and used). I did not check what variables they use from the returned values though. Maybe, to keep it easy, and not break any existing addon: Correct the function's description, and add the correct parameter at the end? |
I use it in VotansImprovedLocations.
I like the idea sirinsidiator suggested in gitter. |
We went with two new functions, GetMapInfoByIndex and GetMapInfoById, both with the correct zoneIndex param. Then we put a GetMapInfo function into the compat alias file with the "uncorrection" for existing addons to use until they update.
Thanks all! |
Does that mean GetMapInfoById will use mapIds as returned from GetCurrentMapId() and such?
|
Yes. We've added a variety of mapId specific APIs to make maps easier to use. They'll be in the next major update after the one coming up.
|
All times are GMT -6. The time now is 08:19 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI