Thread Tools Display Modes
07-18-18, 01:27 PM   #1
Uggers
A Fallenroot Satyr
 
Uggers's Avatar
Join Date: May 2008
Posts: 26
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
  Reply With Quote
07-18-18, 02:16 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
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.
__________________
  Reply With Quote
07-19-18, 11:18 AM   #3
Uggers
A Fallenroot Satyr
 
Uggers's Avatar
Join Date: May 2008
Posts: 26
Hey,

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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » SetMap - Addon Assitance

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off