Mounty #TLV

Mounty #TLV

2k Downloads

Addon tries to call Dragonriding mount in Pandaria

jf647 opened this issue ยท 11 comments

commented

/dump C_MountJournal.GetCollectedDragonridingMounts() returns { 1563, 1589, 1590, 1591 }

/dump C_MountJournal.GetMountInfoByID(1563) returns { "Highland Drake", 360954, ... }

/dump IsUsableSpell(360954) returns { true, false }

/dump C_Map.GetBestMapForUnit("player") returns 424 (which is Pandaria per wowpedia)

Version: Mounty 2.7.0.3

Mounty Why output:

durability => 50% > dragonflight area > summon dragon > all 4 usable > random pick -> Dragon - Cliffside Wylderdrake
commented

Prior to switching to Mounty, I had my own addon that tried to do this, and I had to settle on a zone string match to determine if Dragonriding was allowed:

function dragonridingEnabled(zone)
	return zone == "Dragon Isles" and (not IsInInstance() or zone == "The Nokhud Offensive")
end
commented

Hi,

thank you very much for the very detailed issue!!!

I'd like to reconstruct the issue.

Where exactly are you so GetBestMapForUnit returns 424/Pandaria instead of a map of higher level?

Your solution lacks the check of being on Dragon isles but inside of buildings, where IsInside () or IsOutside () don't seem to be fully reliable, too, as the web tells me.

But let's find a perfect way together, please.

#tlv

commented

I tried to reproduce, and the map ID may be the root cause. I had tried to use Mounty magic right after using Wormhole Generator: Pandaria. One of the spots that can take you is the lake in Kun-Lai Summit at 43,84 which is where I was when I used Mounty.

Unfortunately the place is random. I tried porting again and ended up in Town-Long Steppes, but even immediately after porting the MapID was 388 (which is correct). I tried to fly to the Kun-Lai lake, but entering it from within the zone results in the expected MapID (379).

I suspect the issue may be because that particular port spot drops you off way in the air, so until you change subzones, perhaps the client only knows the continent rather than the zone. I'll try to reproduce (toy has a 4h cooldown and there are 9 possible spots, so it might take a few days), but if I can reproduce the 424 map ID immediately after getting ported to the lake, I think this is an understandable edge case and not worth addressing in Mounty for the small subset of engineers who regularly travel to Pandaria these days.

commented

That's what I thought. Also happened every time, when ported back to Oribos. Before touching ground, it was flyable for a split second. ^^

commented

Ahhh, maybe I switch from ADDON_LOADED to PLAYER_ENTERING_WORLD. Worth a try.

commented

But now I also implemented a continent check, so if not on Dragon Isles, Mounty won't summon dragons at all. Coming soon.

Hopefully they won't allow dragon riding on other continents soon. ^^

commented

On the right track. When porting to Oribos and spamming C_Map.GetBestMapForUnit("player") this happens:

[09:52] Mounty #TLV v2.7.0.4: map id: 1550.
[09:52] Channel gewechselt: [1. Allgemein - Oribos]
[09:52] Channel gewechselt: [3. LokaleVerteidigung - Oribos]
[09:52] Mounty #TLV v2.7.0.4: map id: 1670.

commented

This is how I fixed it: Before starting the magic process I let Mounty check first, if the player is in a true zone. This work's well, having been tested by using portals between Stormwind and Oribos.

function TLVlib:IsInTrueZone()
    local mapID = C_Map.GetBestMapForUnit("player")
    if (mapID) then
        local info = C_Map.GetMapInfo(mapID)
        if (info) then
            return info['mapType'] > 2
        end
    end
    return false
end
commented

Thanks for your input. Helped a lot!

#tlv

commented

I was able to reproduce the MapID issue with the lake. Interestingly if you log out in the middle of the lake and then log back in, you'll get mapID 424 consistently until you swim about ~10y from the center point, at which point you start getting mapID 379.

Thanks for the quick response and fix to the addon.

commented

yw!

#tlv