From 4dd64d1354dd0b6dd9639dbeae23bc1fb2a294ad Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sat, 2 Jul 2011 23:14:09 +0200 Subject: [PATCH] Adding missing API *cough* --- Monomyth.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Monomyth.lua b/Monomyth.lua index 9c7cf8d..1f05588 100644 --- a/Monomyth.lua +++ b/Monomyth.lua @@ -33,11 +33,16 @@ Monomyth:Register('QUEST_GREETING', function() end end) +-- This should be part of the API, really +local function IsQuestCompleted(index) + return not not select(index * 4, GetGossipActiveQuests()) +end + Monomyth:Register('GOSSIP_SHOW', function() local active = GetNumGossipActiveQuests() if(active > 0) then - for index = 1, select('#', GetGossipActiveQuests()), 4 do - if(select(index + 3, GetGossipActiveQuests())) then + for index = 1, active do + if(IsQuestCompleted(index)) then SelectGossipActiveQuest(index) end end -- 1.7.9.5