From 3188e0d9f7e48b605ea2b0a61302373f963d9d7e Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 13 Oct 2013 22:37:09 +0400 Subject: [PATCH] fixed ancient autoequip bug: items were not equiped if only one reward was offered --- AutoTurnIn.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 5e7a0b3..ae723cd 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -400,7 +400,7 @@ function AutoTurnIn:ItemLevel(itemLink) end -- 7 for heirloom http://wowprogramming.com/docs/api_types#itemQuality local invQuality, invLevel = select(3, GetItemInfo(itemLink)) - return (invQuality == 7) and math.huge or itemLink + return (invQuality == 7) and math.huge or invLevel end -- turns quest in printing reward text if `showrewardtext` option is set. @@ -416,8 +416,10 @@ function AutoTurnIn:TurnInQuest(rewardIndex) if (GetNumQuestChoices() > 1) then self:Print(L["gogreedy"]) end - else - local name = GetQuestItemInfo("choice", rewardIndex) + end + + if (not self.forceGreed) then + local name = GetQuestItemInfo("choice", (GetNumQuestChoices() == 1) and 1 or rewardIndex) if (AutoTurnInCharacterDB.autoequip and (strlen(name) > 0)) then local lootLevel, _, _, _, _, equipSlot = select(4, GetItemInfo(GetQuestItemLink("choice", rewardIndex))) -- 1.7.9.5