GithubHelp home page GithubHelp logo

Comments (11)

jf647 avatar jf647 commented on August 15, 2024

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

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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

from mounty.

jf647 avatar jf647 commented on August 15, 2024

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.

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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. ^^

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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.

from mounty.

last-voice avatar last-voice commented on August 15, 2024

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

from mounty.

last-voice avatar last-voice commented on August 15, 2024

Thanks for your input. Helped a lot!

#tlv

from mounty.

jf647 avatar jf647 commented on August 15, 2024

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.

from mounty.

last-voice avatar last-voice commented on August 15, 2024

yw!

#tlv

from mounty.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.