C_Map.GetPlayerMapPosition fails in WoD Garrison

This is just a warning to fellow addon developers of a recent change that caught me by surprise in 8.3, but isn’t really a big deal.

Issue: In 8.3, C_Map.GetPlayerMapPosition now returns nil when players return to the legacy WoD Garrison (where everything is individually phased).

Impact: Extremely low

Suggested Solution: Addons should ensure a non-nil return value.

Example:

local map = C_Map.GetBestMapForUnit("player");
if (map) then
    local position = C_Map.GetPlayerMapPosition(map, "player");
    if (position) then
       print(position:GetXY());
    end
end
1 Like