From e62f58f300e304e17b0200828f865850d25076ba Mon Sep 17 00:00:00 2001
From: Ken Paulson <ken@muffinmangames.com>
Date: Sun, 22 Jul 2018 16:53:58 -0400
Subject: [PATCH 1/3] Fixes issue #44 which still happens on occasion

---
 externals/size_to_fit.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/externals/size_to_fit.lua b/externals/size_to_fit.lua
index 20f5354..3ec8383 100644
--- a/externals/size_to_fit.lua
+++ b/externals/size_to_fit.lua
@@ -29,5 +29,7 @@ function ns.SizeToFit(self)
 
 	-- Now resize ourself
 	local _, _, width, height = self:GetBoundsRect()
-	self:SetSize(width, height)
+	if(width ~= nil and height ~= nil) then
+		self:SetSize(width, height)
+	end
 end

From f48fc9c5d21ee4f44adf32ad6a69d5cc5d27b375 Mon Sep 17 00:00:00 2001
From: Ken Paulson <ken@muffinmangames.com>
Date: Sun, 22 Jul 2018 16:55:05 -0400
Subject: [PATCH 2/3] Issue #48: Garrison Resources can be purchased with
 alt-click again

---
 frames/MerchantItem.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frames/MerchantItem.lua b/frames/MerchantItem.lua
index 2686a1a..15dbb73 100644
--- a/frames/MerchantItem.lua
+++ b/frames/MerchantItem.lua
@@ -41,7 +41,7 @@ end
 
 local function OnClick(self, button)
 	local id = self:GetID()
-	local hasaltcurrency = (GetMerchantItemCostInfo(id) > 0)
+	local hasaltcurrency = ((GetMerchantItemCostInfo(id) > 0) and (select(4,GetMerchantItemCostItem(id, 1)) ~= "Garrison Resources"))
 
 	if IsAltKeyDown() and not hasaltcurrency then
 		self:BuyItem(true)

From fbdf467ab17650afd123231e6b822589765fb5c6 Mon Sep 17 00:00:00 2001
From: Ken Paulson <ken@muffinmangames.com>
Date: Thu, 26 Jul 2018 17:12:14 -0400
Subject: [PATCH 3/3] Changed look up to use currency ID rather than an English
 name (thanks ckaotic) Uses a key lookup instead of a string compare and
 easily expands to support any other currencies that this would be needed for

---
 frames/MerchantItem.lua | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/frames/MerchantItem.lua b/frames/MerchantItem.lua
index 15dbb73..3e3a8e2 100644
--- a/frames/MerchantItem.lua
+++ b/frames/MerchantItem.lua
@@ -38,10 +38,14 @@ local function RequiresConfirmation(index)
 	if not HasAllCommonBarterItems(index) then return true end
 end
 
+local alt_click_exceptions = {}
+alt_click_exceptions[GetCurrencyInfo(824)] = true
+-- Add any other exceptional currencies here
 
 local function OnClick(self, button)
 	local id = self:GetID()
-	local hasaltcurrency = ((GetMerchantItemCostInfo(id) > 0) and (select(4,GetMerchantItemCostItem(id, 1)) ~= "Garrison Resources"))
+	local currencyname = select(4,GetMerchantItemCostItem(id, 1))
+	local hasaltcurrency = ((GetMerchantItemCostInfo(id) > 0) and (alt_click_exceptions[currencyname] == nil))
 
 	if IsAltKeyDown() and not hasaltcurrency then
 		self:BuyItem(true)