Skip to content

Commit

Permalink
PhaseIcon: Fix for 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed Jul 30, 2020
1 parent 15d5f86 commit 2e82a09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ globals = {
"UnitHealth",
"UnitHealthMax",
"UnitInParty",
"UnitInPhase",
"UnitInPhase", -- gone in wow_900
"UnitInRaid",
"UnitInRange",
"UnitIsAFK",
Expand All @@ -166,7 +166,7 @@ globals = {
"UnitIsTapDenied",
"UnitIsUnit",
"UnitIsVisible",
"UnitIsWarModePhased",
"UnitIsWarModePhased", -- gone in wow_900
"UnitIsWildBattlePet",
"UnitLevel",
"UnitName",
Expand All @@ -176,6 +176,7 @@ globals = {
"UnitPowerDisplayMod",
"UnitPowerMax",
"UnitPowerType",
"UnitPhaseReason",
"UnitRace",
"UnitReaction",
"UnitSelectionColor",
Expand Down
11 changes: 10 additions & 1 deletion Modules/PhaseIcon/PhaseIcon.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local wow_900 = select(4, GetBuildInfo()) > 90000

local PitBull4 = _G.PitBull4
local L = PitBull4.L
Expand All @@ -24,7 +25,15 @@ end
function PitBull4_PhaseIcon:GetTexture(frame)
local unit = frame.unit
-- Note the UnitInPhase function doesn't work for pets.
if not unit or not UnitIsPlayer(unit) or (UnitInPhase(unit) and not UnitIsWarModePhased(unit)) or not UnitExists(unit) or not UnitIsConnected(unit) then
if not unit or not UnitIsPlayer(unit) or not UnitExists(unit) or not UnitIsConnected(unit) then
return nil
end

if wow_900 then
if not UnitPhaseReason() then
return nil
end
elseif UnitInPhase(unit) and not UnitIsWarModePhased(unit) then
return nil
end

Expand Down

0 comments on commit 2e82a09

Please sign in to comment.