Thread Tools Display Modes
Prev Previous Post   Next Post Next
03/12/15, 05:58 PM   #1
Balver
 
Balver's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 39
Double output

I'm trying to modify an outdated addon (El Chivato) for myself and there's a bug I can't fix with my limited coding knowledge.
When I complete a quest the XP appear twice.


The code I use is:
Lua Code:
  1. local function PrintXP(color, text)
  2.     -- convert text to string to prevent passing nil arguments to d
  3.     d(color .. tostring(text))
  4. end
  5.  
  6.  
  7. -- Finish a Quest
  8. local function OnQuestCompleteXP(event, questName, level, prevXP, newXP, rank, prevVP, newVP)
  9.         PrintXP(colors.Quest, "Completed Quest: " .. questName ..". +" .. newXP - prevXP .. " XP")
  10. end
  11.  
  12. -- Finish a Quest
  13. EVENT_MANAGER:RegisterForEvent(Chivato.name, EVENT_QUEST_COMPLETE, OnQuestCompleteXP)

In the Wiki I read "- For some quests, can triggers twice " for EVENT_QUEST_COMPLETE so it seems to be an API problem.
Is there a way to prevent a double output?

And when I'm here already, how do I get rid of the suffixes in German names? I've seen that other addons managed to do this.



Thanks in advance!
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Double output


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off