Quantcast

Use a local instead

Adrian L Lange [02-05-12 - 14:44]
Use a local instead
Filename
Monomyth.lua
diff --git a/Monomyth.lua b/Monomyth.lua
index 9e2beba..302bb58 100644
--- a/Monomyth.lua
+++ b/Monomyth.lua
@@ -93,12 +93,13 @@ Monomyth:Register('QUEST_ITEM_UPDATE', function(...)
 end)

 Monomyth:Register('QUEST_COMPLETE', function()
-	if(GetNumQuestChoices() <= 1) then
+	local choices = GetNumQuestChoices()
+	if(choices <= 1) then
 		GetQuestReward(QuestFrameRewardPanel.itemChoice)
-	elseif(GetNumQuestChoices() > 1) then
+	elseif(choices > 1) then
 		local bestValue, bestIndex = 0

-		for index = 1, GetNumQuestChoices() do
+		for index = 1, choices do
 			local link = GetQuestItemLink('choice', index)
 			if(link) then
 				local _, _, _, _, _, _, _, _, _, _, value = GetItemInfo(link)