WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   SetMap - Addon Assitance (https://www.wowinterface.com/forums/showthread.php?t=56379)

Uggers 07-18-18 01:27 PM

SetMap - Addon Assitance
 
I currently have an addon which is throwing up errors it appears to be related to the fact it can't set the map/get the map ID.

The code I have for this portion is like this;

Code:

function MountManager:ZONE_CHANGED_NEW_AREA()
        if not InCombatLockdown() then
                SetMapToCurrentZone();
                state.zone = GetCurrentMapAreaID()
        end
       
        self:UpdateZoneStatus()
end
function MountManager:UpdateZoneStatus(event)
    if InCombatLockdown() or state.inCombat or state.inPetBattle then return end
   
    local prevSwimming = state.isSwimming
    local prevFlyable = state.isFlyable
   
    state.isSwimming = IsSwimming() or IsSubmerged()
   
        local usable, _ = IsUsableSpell(flightTest)
    if IsFlyableArea() and self.db.char.mount_skill > 2 and usable == true then
        state.isFlyable = true
    else
        state.isFlyable = false
    end
   
    if (prevSwimming ~= state.isSwimming) or (prevFlyable ~= state.isFlyable) then
        self:GenerateMacro()
    end
end

I'm not sure if its SetMapToCurrentZone or GetCurrentMapAreaID that needs updating, I tried changing to C_Map.GetAreaInfo but I still get this error;

Code:

20x MountManager\MountManager-v1.0.0.lua:260: attempt to call upvalue 'SetMapToCurrentZone' (a nil value)
MountManager\MountManager-v1.0.0.lua:260: in function `?'
...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:145: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:145>
[string "safecall Dispatcher[1]"]:4: in function <[string "safecall Dispatcher[1]"]:4>
[C]: ?
[string "safecall Dispatcher[1]"]:13: in function `?'
...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:90: in function `Fire'
Ace3\AceEvent-3.0\AceEvent-3.0-4.lua:120: in function <Ace3\AceEvent-3.0\AceEvent-3.0.lua:119>

Locals:
nil


Xrystal 07-18-18 02:16 PM

The whole of the map system was changed. While in game you can query the map ui by typing /api map or /api mapui . I can never remember which. There is also a command /api system or systems which will list the different api's that can be listed in detail. There have been various posts regarding the up and coming changes on these forums for a few months now.


Looking at the blizzard code here :
https://www.townlong-yak.com/framexml/beta/MapUtil.lua

The function I feel may be the best equivalent for you is :
MapUtil.GetDisplayableMapForPlayer()

However, there may be others who have looked into the mapping system in more detail and have a more accurate one for you.

Uggers 07-19-18 11:18 AM

Hey,

thanks for the reply, sadly it didn't seem to fix it, I tried a few variations but It wouldn't work


All times are GMT -6. The time now is 07:07 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI