From ee9db0510b5c7300286c3938b90641ea827f06d7 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 13 Jan 2021 22:36:28 -0500 Subject: [PATCH 1/2] Return logic directly instead of using conditional (fixes #4) --- MyAddon.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/MyAddon.lua b/MyAddon.lua index 9262c16..1765de7 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -135,11 +135,7 @@ function MyAddon.amTankInParty() local isTank = UnitGroupRolesAssigned("player") == "TANK" local notAlreadyMarked = GetRaidTargetIndex("player") == nil - if (isParty and isTank and notAlreadyMarked) then - return true - else - return false - end + return isParty and isTank and notAlreadyMarked end function MyAddon.markSelfSquare() -- 2.45.2 From f7684d4010b3d49dc4854c867b3a78bb8683a3f3 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 13 Jan 2021 22:37:54 -0500 Subject: [PATCH 2/2] Prefer print to attaching to default chat frame (fixes #7) --- MyAddon.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MyAddon.lua b/MyAddon.lua index 1765de7..ae31f62 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -50,7 +50,7 @@ function events:MERCHANT_SHOW(...) -- Repair if we need to and merchant allows it if CanMerchantRepair() and MyAddon.needsRepair() then RepairAllItems(CanGuildBankRepair()) - DEFAULT_CHAT_FRAME:AddMessage("Your items have been repaired") + print("Your items have been repaired") end end @@ -123,7 +123,7 @@ function MyAddon.sellGrayItems() for slot = 1, GetContainerNumSlots(bag) do local name = GetContainerItemLink(bag, slot) if name and string.find(name, "ff9d9d9d") then - DEFAULT_CHAT_FRAME:AddMessage("Selling "..name) + print("Selling "..name) UseContainerItem(bag, slot) end end -- 2.45.2