Azeroth Pilot Reloaded

Azeroth Pilot Reloaded

2M Downloads

[ISSUE] - C_Map.GetMapInfo

gaveer opened this issue ยท 3 comments

commented

Description

Error after exit the dungeon

APR Version

APR 3.0.3

APR Route

Speedrun

World of Warcraft Flavor

Retail (Default)

Tested with only APR

  • Yes
  • No

Lua Error

226x APR-Core/Map.lua:58: Usage: local info = C_Map.GetMapInfo(uiMapID)
[string "=[C]"]: in function `GetMapInfo'
[string "@APR-Core/Map.lua"]:58: in function <APR-Core/Map.lua:55>
[string "@APR-Core/Map.lua"]:198: in function `UpdateMinimapLine'
[string "@APR-Core/Map.lua"]:132: in function <APR-Core/Map.lua:130>

Locals:
(*temporary) = nil

Reproduction Steps

Enter Dungeon
Exit dungeon

Last Good Version

No response

Screenshots

No response

Any additional information?

No response

commented
local function checkIsInRouteZone()
    if APR.FP.GoToZone then
        local currentMapID = C_Map.GetBestMapForUnit("player")
        local parentMapID = C_Map.GetMapInfo(currentMapID).parentMapID
        local childrenMap = C_Map.GetMapChildrenInfo(parentMapID)

        local isPresent = false
        for _, map in ipairs(childrenMap) do
            if map.mapID == APR.FP.GoToZone then
                isPresent = true
                break
            end
        end
        return isPresent
    end
    return true
end

changed to

local function checkIsInRouteZone()
    if APR.FP.GoToZone then
        local currentMapID = C_Map.GetBestMapForUnit("player")

        if currentMapID then
            local mapInfo = C_Map.GetMapInfo(currentMapID)

            if mapInfo then
                local parentMapID = mapInfo.parentMapID
                local childrenMap = C_Map.GetMapChildrenInfo(parentMapID)

                local isPresent = false
                for _, map in ipairs(childrenMap) do
                    if map.mapID == APR.FP.GoToZone then
                        isPresent = true
                        break
                    end
                end
                return isPresent
            end
        end
    end

    return true
end


commented

another error

27x APR-Core/helpers/PlayerPosition.lua:35: Usage: local continentID, worldPosition = C_Map.GetWorldPosFromMapPos(uiMapID, mapPosition)
[string "=[C]"]: in function `GetWorldPosFromMapPos'
[string "@APR-Core/helpers/PlayerPosition.lua"]:35: in function `GetPlayerMapPos'
[string "@APR-Core/Map.lua"]:374: in function `AddMapPins'
[string "@APR-Core/Map.lua"]:439: in function <APR-Core/Map.lua:415>

Locals:
(*temporary) = nil
(*temporary) = <table> {
 DivideBy = <function> defined @SharedXML/Vector2D.lua:90
 GetLength = <function> defined @SharedXML/Vector2D.lua:118
 Normalize = <function> defined @SharedXML/Vector2D.lua:122
 Dot = <function> defined @SharedXML/Vector2D.lua:106
 GetLengthSquared = <function> defined @SharedXML/Vector2D.lua:114
 GetXY = <function> defined @SharedXML/Vector2D.lua:77
 OnLoad = <function> defined @SharedXML/Vector2D.lua:68
 IsZero = <function> defined @SharedXML/Vector2D.lua:110
 RotateDirection = <function> defined @SharedXML/Vector2D.lua:126
 x = 0
 y = 0
 IsEqualTo = <function> defined @SharedXML/Vector2D.lua:72
 Clone = <function> defined @SharedXML/Vector2D.lua:130
 Cross = <function> defined @SharedXML/Vector2D.lua:102
 Subtract = <function> defined @SharedXML/Vector2D.lua:98
 SetXY = <function> defined @SharedXML/Vector2D.lua:81
 ScaleBy = <function> defined @SharedXML/Vector2D.lua:86
 Add = <function> defined @SharedXML/Vector2D.lua:94
}

commented

the entire transport and player position detection logic is currently being reworked, this bug has already been fixed locally

well.. in any case I've just completely redone the function to take into account other parameters
A beta version will soon be available with all the changes