From 88e363b90b2985a3d9a0114544b00badd11c1870 Mon Sep 17 00:00:00 2001 From: urnati Date: Fri, 9 Aug 2019 03:04:42 -0400 Subject: [PATCH] Update Ammo to fix thrown count --- TitanClassicAmmo/TitanClassicAmmo.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/TitanClassicAmmo/TitanClassicAmmo.lua b/TitanClassicAmmo/TitanClassicAmmo.lua index cac6139..36fce10 100644 --- a/TitanClassicAmmo/TitanClassicAmmo.lua +++ b/TitanClassicAmmo/TitanClassicAmmo.lua @@ -141,14 +141,25 @@ end function TitanPanelAmmoButton_UNIT_INVENTORY_CHANGED(arg1, ...) ---TitanDebug("TitanPanelAmmoButton_UNIT_INVENTORY_CHANGED") if arg1 == "player" then +TitanDebug("TitanPanelAmmoButton_UNIT_INVENTORY_CHANGED") TitanPanelAmmoUpdateDisplay(); + if isThrown then + count = GetInventoryItemCount("player", rangedSlotID) or count + elseif isAmmo then --and GetInventoryItemLink("player", ammoSlotID) + count = GetInventoryItemCount("player", ammoSlotID) or count + -- AmmoName = GetItemInfo(GetInventoryItemLink("player", ammoSlotID)) or _G["UNKNOWN"] + else + --isThrown = nil; + count = 0; + AmmoName = ""; + end + TitanPanelButton_UpdateButton(TITAN_AMMO_ID); -- if isAmmo then -- TitanDebug("ammoSlotID: " .. ammoSlotID); -- TitanDebug("GetInventoryItemLink: " .. tostring(GetInventoryItemLink("player", ammoSlotID))); -- if GetInventoryItemLink("player", ammoSlotID) then - count = GetInventoryItemCount("player", ammoSlotID) or count +-- count = GetInventoryItemCount("player", ammoSlotID) or count -- AmmoName = GetItemInfo(GetInventoryItemLink("player", ammoSlotID)) or _G["UNKNOWN"] -- else -- count = 0; -- 1.7.9.5