Quantcast

- TitanClassicAmmo: Fixed some logic for inventory count for warriors.

HonorGoG [08-16-19 - 01:59]
- TitanClassicAmmo: Fixed some logic for inventory count for warriors.
Filename
TitanClassicAmmo/TitanClassicAmmo.lua
diff --git a/TitanClassicAmmo/TitanClassicAmmo.lua b/TitanClassicAmmo/TitanClassicAmmo.lua
index 1b36fec..2606f94 100644
--- a/TitanClassicAmmo/TitanClassicAmmo.lua
+++ b/TitanClassicAmmo/TitanClassicAmmo.lua
@@ -98,7 +98,7 @@ function TitanPanelAmmoButton_PLAYER_LOGIN()
 		TitanPanelAmmoButton:RegisterEvent("UPDATE_INVENTORY_DURABILITY")
 		isThrown = true;
 		isAmmo = nil;
-	else
+	elseif loc == "INVTYPE_RANGEDRIGHT" then
 		TitanPanelAmmoButton:RegisterEvent("ACTIONBAR_HIDEGRID")
 		isAmmo = true;
 		isThrown = nil;
@@ -189,7 +189,7 @@ function TitanPanelAmmoUpdateDisplay()
 		count = GetInventoryItemCount("player", rangedSlotID) or count
 --			count = GetInventoryItemDurability(rangedSlotID);

-	else
+	else loc == "INVTYPE_RANGEDRIGHT" then

 		if TitanPanelAmmoButton:IsEventRegistered("UPDATE_INVENTORY_DURABILITY") then
 			TitanPanelAmmoButton:UnregisterEvent("UPDATE_INVENTORY_DURABILITY")
@@ -202,6 +202,9 @@ function TitanPanelAmmoUpdateDisplay()
 		isAmmo = true;
 		isThrown = nil;
 		count = GetInventoryItemCount("player", ammoSlotID)
+	else
+		count = 0;
+		AmmoName = "";
 	end

 	TitanPanelButton_UpdateButton(TITAN_AMMO_ID);