From 6624d74b2a15f7b4986d79f5b796e97b7cc8f649 Mon Sep 17 00:00:00 2001 From: Parnic Date: Thu, 22 Sep 2016 13:33:42 -0500 Subject: [PATCH] Fixed sometimes choosing invalid items to break When the player had items where one was a substring of the other ("Whiptail" vs "Whiptail Stem", for example), the game client would sometimes pick the wrong one to break. In the Whiptail case, this meant the game could attempt to cast Mill on a Whiptail Stem if it appeared first in the player's bags, which doesn't work. All we can do with the target-item attribute is supply a name, so it's not really our fault that the game makes this decision, but we can work around it by using target-bag and target-slot instead of target-item where we can be explicit about what we're trying to break. --- Breakables.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Breakables.lua b/Breakables.lua index c4f573f..0ec956b 100644 --- a/Breakables.lua +++ b/Breakables.lua @@ -803,15 +803,15 @@ function Breakables:FindBreakables(bag) --or PickLockId) btn:SetAttribute("spell", BreakableAbilityName) - if isLockedItem then - btn:SetAttribute("target-item") + --if isLockedItem then + --btn:SetAttribute("target-item") btn:SetAttribute("target-bag", foundBreakables[i][IDX_BAG]) btn:SetAttribute("target-slot", foundBreakables[i][IDX_SLOT]) - else + --[[else btn:SetAttribute("target-item", foundBreakables[i][IDX_NAME]) btn:SetAttribute("target-bag") btn:SetAttribute("target-slot") - end + end]] if lbfGroup then btn.icon:SetTexture(foundBreakables[i][IDX_TEXTURE])