From 04d3323abaa7f8996c8a179949c0c96543e0c7c6 Mon Sep 17 00:00:00 2001 From: urnati Date: Sat, 27 Jan 2024 07:08:07 -0500 Subject: [PATCH] - Ammo : Fix for Thrown difference between Wrath and CE --- TitanAmmo/TitanClassicAmmo.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/TitanAmmo/TitanClassicAmmo.lua b/TitanAmmo/TitanClassicAmmo.lua index 39447e5..d3d0a45 100644 --- a/TitanAmmo/TitanClassicAmmo.lua +++ b/TitanAmmo/TitanClassicAmmo.lua @@ -28,6 +28,8 @@ local LIM_GOOD = 2 local LIM_OK = 1.5 local LIM_BAD = .5 +local game_version = select(4, GetBuildInfo()) + local TITAN_AMMO_THRESHOLD_TABLE = { -- Use ammo stack and threshold limits above to calc colored text ["INVTYPE_RANGEDRIGHT"] = { Values = { SHOOT_STACK*LIM_BAD, SHOOT_STACK*LIM_OK, SHOOT_STACK*LIM_GOOD }, -- 100,150,400 @@ -149,8 +151,23 @@ local function GetAmmoCount() subammoID = subclassID label = L["TITAN_AMMO_BUTTON_LABEL_THROWN"] - text = TitanUtils_GetGoldText("*") + ammo_name = select(1, GetItemInfo(GetInventoryItemID("player", rangedSlotID))) or _G["UNKNOWN"] + if ammo_name == _G["UNKNOWN"] then + ammo_count = 0 + else + if game_version < 30000 then + -- CE thrown has count + ammo_count = GetInventoryItemCount("player", rangedSlotID) or ammo_count + text = format(L["TITAN_AMMO_FORMAT"], ammo_count); + else + -- Wrath thrown has no count or durability + text = TitanUtils_GetGoldText("*") + end + end + if TitanGetVar(TITAN_AMMO_ID, "ShowAmmoName") and ammo_name ~= "" then + text = text.."|cffffff9a".." ("..ammo_name..")".."|r" + end tool_tip = itemName -- no mismatch elseif (subclassID == 3) -- Gun -- 1.7.9.5