GetPlayerMapPosition - 7.1
This now seems to return zero after performing a ReloadUI requiring a complete logout or exit to restore.
Edit: it now returns to producing coordinates after exiting an instance or crossing a zone boundry but still zeros moving in your current non-instanced zone after a ReloadUI. |
Just to make sure; you're aware of the changes to this function?
|
Indeed, I ReloadUI and get zeros and nil/zeros going into/out of instances.
Logout/on and it's coordinates and nil/coordinates going into/out of instances. Edit: It's now ReloadUI and get zeros and nil/coordinates going into/out of instances, not sure if there was a hotfix since the last time I tried it. |
Well, you aren't supposed to get coords while in instance, so it works as intended... o_O
|
I get zeros after ReloadUI while not in an instance. The instance in/out part seems to be working now where originally I was still getting zeros after exiting an instance.
|
What happens if you run SetMapToCurrentZone()? If it's somehow loading up the map for an area you're not in, it's not going to give you your coordinates on it.
|
Quote:
|
I was was running SetMapToCurrentZone() on ZONE_CHANGED_NEW_AREA. I added PLAYER_ENTERING_WORLD and that fixed it. Thank you.
Edit for typo in the event name not causing it to trigger. Did ZONE_CHANGED_NEW_AREA used to happen when logging on? |
Further testing on a rogue order hall with ZONE_CHANGED_NEW_AREA or PLAYER_ENTERING_WORLD registered and both calling SetMapToCurrentZone() when fired.
Glorious Goods entrance: Niether event is fired entering or exiting the order hall. GetPlayerMapPosition("player") returns zeros when entering and coordinates when leaving. EDIT: GetPlayerMapPosition("player") appears to be switching states. ie. if it's displaying zeros before entering it will show coordinates inside. if it's displaying coordinates before entering it will show zeros inside. One More Glass entrance: On entering, neither event is fired and GetPlayerMapPosition("player") returns zeros on entering (expected). On exiting, PLAYER_ENTERING_WORLD is fired which calls SetMapToCurrentZone() but GetPlayerMapPosition("player") still returns zeros. Going to from my mage order hall gets both events entering and exiting and gets coordinates inside the order hall (I didn't expect that). |
Just to make sure that you are only using SetMapToCurrentZone() by checking if WorldMapFrame:IsVisible() is false right? Otherwise you will do all sorts of nasty things when a user opens their world map (like reset to current zone if they select a new zone with the map open and your addon triggering)
|
That's the general consensus of how it's used, though there is another method I developed years ago. It would let you get data in the zone the user is in while the WorldMapFrame is up and they would never know.
|
Testing on a rogue with one addon consisting of the following
Lua Code:
Logon displays coordinates. Enter the order hall via Glorious Goods displays zeros. Exit the hall displays coordinates. Enter the hall again - zeros. /reload - zeros Logoff/on inside the hall you now have coordinates. Exit the hall - zeros Exit Glorous Goods - coordinates. Regardless of SetMapToCurrentZone(), GetPlayerMapPosition() is getting zone information and in some cases toggling how it functions. Whether this is just the rogue hall, certain order halls or certain types of instances I don't know. |
Same test at the One More Glass entrance, same result with the exception that you don't get coordinates back when you exit but will once you cross the zone boundry by taking a taxi.
|
Ended up making a rogue using class trial, but I found a solution to the problem. Apparently ZONE_CHANGED_INDOORS is firing at the right time to call SetMapToCurrentZone() from in addition to PLAYER_LOGIN and ZONE_CHANGED_NEW_AREA.
|
ZONE_CHANGED_INDOORS, I hadn't thought of that, thank you. I found opening closing the map reset it without the logout/login.
Now there seems to be a coordinate "dead" zone over the sea around Dalaran when taking a taxi. Most noticable between Dal. and Stormheim. It seems to be being triggered as a dungeon rather than just inside. Not earth shattering but maybe not the only one. |
There are spots in the game where no zone maps cover. These are commonly around the edges of a continent. I don't think SetMapToCurrentZone() ever chooses a continental map anymore, just whatever zone you're closest to or are currently in.
But ya, class halls appear to be scenarios internally, much like Garrisons were in WoD. |
All times are GMT -6. The time now is 09:30 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI