C_Map.GetBestMapForUnit

From Wowpedia
Jump to: navigation, search

Returns the current UI map for the given unit. Only works for the player and party members.

uiMapID = C_Map.GetBestMapForUnit(unitToken)

Arguments

unitToken 
string - UnitId

Returns

uiMapID 
number? - Returns the "lowest" UiMapID the unit is on. For example, if a unit is in a microdungeon it will return that instead of the zone or continent map.

Example

Prints the current map for the player.

/run local mapID = C_Map.GetBestMapForUnit("player"); print(format("You are in %s (%d)", C_Map.GetMapInfo(mapID).name, mapID))
> You are in Stormwind City (84)

Patch changes

See also

External links