ExtraQuestButton

ExtraQuestButton

109k Downloads

Error in Utils.lua

Cluuey opened this issue ยท 3 comments

commented

I got the following error when I picked up an old quest.
It provides an item for the quest although it's a bit different from other items as it's consumed on use, it gives you a buff for ten minutes and when it runs out, or you click it off, the NPC gains another chat option to get more bait. When you get replacement bait the default quest tracking button doesn't come up, you have to find it in your bag and use it.

In my investigation I discovered that GetDistanceSqToQuest and C_TaskQuest.GetDistanceSqToQuest have been removed and C_QuestLog.GetDistanceSqToQuest was added.
So I changed line 58 to:
local distanceSq, onContinent = C_QuestLog.GetDistanceSqToQuest(questID)
That stops the error but the extra quest button doesn't come up. I assume that's because the item gets consumed on use?

[string "@ExtraQuestButton\Utils.lua"]:58: in function <ExtraQuestButton\Utils.lua:18>
[string "@ExtraQuestButton\Utils.lua"]:111: in function `GetClosestQuestItem'
[string "@ExtraQuestButton\ExtraQuestButton-90000.15-Release.lua"]:144: in function `callback'
[string "@ExtraQuestButton\mixins\EventHandlerMixin.lua"]:56: in function <ExtraQuestButton\mixins\EventHandlerMixin.lua:53>

Locals:
questID = 36201
questLogIndex = 32
itemLink = "|cffffffff|Hitem:114874::::::::50:62:::::::|h[Moonshell Claw Bait]|h|r"
_ = 133707
_ = -1
showWhenComplete = false
itemID = 114874
(*temporary) = nil
(*temporary) = 36201
(*temporary) = "attempt to call global 'GetDistanceSqToQuest' (a nil value)"
itemData = <table> {
 targetItems = <table> {
 }
 itemBlacklist = <table> {
 }
 accurateQuestAreas = <table> {
 }
 noCompleteItems = <table> {
 }
 inaccurateQuestAreas = <table> {
 }
 completeItems = <table> {
 }
 questItems = <table> {
 }
}
ns = <table> {
 GetItemID = <function> defined @ExtraQuestButton\Utils.lua:148
 GenerateItemLinkFromID = <function> defined @ExtraQuestButton\Utils.lua:152
 GetClosestQuestItem = <function> defined @ExtraQuestButton\Utils.lua:92
 itemData = <table> {
 }
 GetNPCID = <function> defined @ExtraQuestButton\Utils.lua:139
 GetCurrentMapID = <function> defined @ExtraQuestButton\Utils.lua:156
 Print = <function> defined @ExtraQuestButton\Utils.lua:160
 mixins = <table> {
 }
}
sqrt = <function> defined =[C]:-1
GetDistanceSqToPoint = <function> defined @ExtraQuestButton\Utils.lua:7
commented

Please make sure you have the latest version before you open a ticket, this has already been fixed.

commented

Sorry mate, I hadn't checked since getting the previous update.

It isn't mentioned in the change log.

commented

See changelog for 90000.16-Release