Quantcast

-Updated for MOP

Xruptor [09-24-12 - 23:11]
-Updated for MOP
Filename
XanDurability.lua
XanDurability.toc
diff --git a/XanDurability.lua b/XanDurability.lua
index da5f482..3c09708 100644
--- a/XanDurability.lua
+++ b/XanDurability.lua
@@ -46,6 +46,9 @@ function f:PLAYER_LOGIN()
 	local ver = GetAddOnMetadata("xanDurability","Version") or '1.0'
 	DEFAULT_CHAT_FRAME:AddMessage(string.format("|cFF99CC33%s|r [v|cFFDF2B2B%s|r] Loaded", "xanDurability", ver or "1.0"))

+	f:GetDurabilityInfo()
+	f:UpdatePercent()
+
 	self:UnregisterEvent("PLAYER_LOGIN")
 	self.PLAYER_LOGIN = nil
 end
@@ -170,15 +173,17 @@ function f:GetDurabilityInfo()
 	equipCost = 0
 	for _, slotName in ipairs(Slots) do
 		local item = _G["Character" .. slotName]
-		local hasItem, _, repairCost = tmpTip:SetInventoryItem("player", item:GetID())
-		local Minimum, Maximum = GetInventoryItemDurability(item:GetID())
+		if item then
+			local hasItem, _, repairCost = tmpTip:SetInventoryItem("player", item:GetID())
+			local Minimum, Maximum = GetInventoryItemDurability(item:GetID())

-		if hasItem and repairCost and repairCost > 0 then
-			equipCost = equipCost + repairCost
-		end
-		if Minimum and Maximum then
-			pEquipDura.min = pEquipDura.min + Minimum
-			pEquipDura.max = pEquipDura.max + Maximum
+			if hasItem and repairCost and repairCost > 0 then
+				equipCost = equipCost + repairCost
+			end
+			if Minimum and Maximum then
+				pEquipDura.min = pEquipDura.min + Minimum
+				pEquipDura.max = pEquipDura.max + Maximum
+			end
 		end
 	end

diff --git a/XanDurability.toc b/XanDurability.toc
index 475eba3..981c820 100644
--- a/XanDurability.toc
+++ b/XanDurability.toc
@@ -1,8 +1,8 @@
-## Interface: 40300
+## Interface: 50001
 ## Title: xanDurability
 ## Notes: A small window that displays the total current armour durability.
 ## Author: Xruptor
-## Version: 2.5
+## Version: 2.6
 ## SavedVariablesPerCharacter: XanDUR_DB

 xanDurability.lua