Quantcast

Cheap trick to hide portraits when the unit is offline

Adrian L Lange [08-19-14 - 17:32]
Cheap trick to hide portraits when the unit is offline
Filename
oUF_P3lim.lua
diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua
index d3bf507..9f2cdec 100644
--- a/oUF_P3lim.lua
+++ b/oUF_P3lim.lua
@@ -22,6 +22,10 @@ end
 local function PostUpdateHealth(element, unit, cur, max)
 	local ScrollFrame = element.__owner.Portrait.scrollFrame

+	if(element.disconnected) then
+		cur = 0
+	end
+
 	local offset = -(230 * (1 - cur / max))
 	ScrollFrame:SetPoint('LEFT', offset, 0)
 	ScrollFrame:SetHorizontalScroll(offset)