Quantcast
WoWInterface - View Single Post - Lags on quest objective update
View Single Post
02-19-14, 06:10 AM   #21
sidrat12
A Defias Bandit
Join Date: Feb 2014
Posts: 2
Carbonite.Quests\NxQuest.lua:4375: bad argument #1 to 'ipairs'

Has any one sorted out the problem with the ipairs for NxQuest.lua line 4375.

function Nx.Quest:FindCur (qId, qIndex)

if type (qId) == "string" then -- Quest title?

for n, v in ipairs (self.CurQ) do
if v.Title == qId then
return n, v, qId
end
end

return
end

if qIndex and qId == 0 then
local i, cur = self:FindCurByIndex (qIndex)
return i, cur, cur.Title -- Also return string type id
end

assert (qId > 0)

for n, v in ipairs (self.CurQ) do -- line 4375
if v.QId == qId then
return n, v, qId
end
end
end

bugsack errer reported for Carbonite.Quests\NxQuest.lua

7x Carbonite.Quests\NxQuest.lua:4375: bad argument #1 to 'ipairs' (table expected, got nil)
[C]: in function `ipairs'
Carbonite.Quests\NxQuest.lua:4375: in function `FindCur'
Carbonite.Quests\NxQuest.lua:8266: in function `RemoveWatch'
DugisGuideViewerZ\Guides.lua:1376: in function `WatchQuest'
DugisGuideViewerZ\DugisGuideViewer.lua:2067: in function `SettingFrameChkOnClick'
DugisGuideViewerZ\DugisGuideViewer.lua:666: in function `OnLoad'
DugisGuideViewerZ\DugisGuideViewer.lua:2450: in function `?'
DugisGuideViewerZ\DugisGuideViewer.lua:100: in function <DugisGuideViewerZ\DugisGuideViewer.lua:89>
[C]: ?

Locals:
self = <table> {
RecordQuests = <function> defined @Carbonite.Quests\NxQuest.lua:3047
UnpackCategory = <function> defined @Carbonite.Quests\NxQuest.lua:9641
IsTargeted = <function> defined @Carbonite.Quests\NxQuest.lua:9417
Menu_OnTrack = <function> defined @Carbonite.Quests\NxQuest.lua:2822
GetLogIdLevel = <function> defined @Carbonite.Quests\NxQuest.lua:3838
Menu_OnShowQuest = <function> defined @Carbonite.Quests\NxQuest.lua:2835
GetQuestReward = <function> defined @Carbonite.Quests\NxQuest.lua:2872
DecodeComRcv = <function> defined @Carbonite.Quests\NxQuest.lua:10343
MsgNotInDB = <function> defined @Carbonite.Quests\NxQuest.lua:4798
OnChat_msg_raid_boss_whisper = <function> defined @Carbonite.Quests\NxQuest.lua:4842
Watch = <table> {
}
FinishQuest = <function> defined @Carbonite.Quests\NxQuest.lua:2881
CalcDistances = <function> defined @Carbonite.Quests\NxQuest.lua:9860
SortQuests = <function> defined @Carbonite.Quests\NxQuest.lua:3885
SetCols = <function> defined @Carbonite.Quests\NxQuest.lua:2752
TooltipHook = <function> defined @Carbonite.Quests\NxQuest.lua:4875
CheckQuestSE = <function> defined @Carbonite.Quests\NxQuest.lua:2762
CurQSetPreviousDone = <function> defined @Carbonite.Quests\NxQuest.lua:3706
OnChat_msg_combat_faction_change = <function> defined @Carbonite.Quests\NxQuest.lua:4056
CaptureGetCount = <function> defined @Carbonite.Quests\NxQuest.lua:4221
TooltipProcess2 = <function> defined @Carbonite.Quests\NxQuest.lua:4906
UpdateQuestDetailsTimer = <function> defined @Carbonite.Quests\NxQuest.lua:7552
BuildQSendData = <function> defined @Carbonite.Quests\NxQuest.lua:4732
GetClosestObjectivePos = <function> defined @Carbonite.Quests\NxQuest.lua:9992
OnChat_msg_addon = <function> defined @Carbonite.Quests\NxQuest.lua:1936
CalcWatchColors = <function> defined @Carbonite.Quests\NxQuest.lua:2788
ExtractTitle = <function> defined @Carbonite.Quests\NxQuest.lua:3862
CalcCNumMax = <function> defined @Carbonite.Quests\NxQuest.lua:3689
ScanBlizzQuestDataZone = <function> defined @Carbonite.Quests\NxQuest.lua:3617
BuildComSend = <function> defined @Carbonite.Quests\NxQuest.lua:10283
FindCur = <function> defined @Carbonite.Quests\NxQuest.lua:4355
WatchAll = <function> defined @Carbonite.Quests\NxQuest.lua:4482
SelectBlizz = <function> defined @Carbonite.Quests\NxQuest.lua:2924
IconOnEnter = <function> defined @Carbonite.Quests\NxQuest.lua:7479
ShowUIPanel = <function> defined @Carbonite.Quests\NxQuest.lua:5406
UnpackLocPtOff = <function> defined @Carbonite.Quests\NxQuest.lua:10695
QuestQueryTimer = <function> defined @Carbonite.Quests\NxQuest.lua:3793
GetObjectiveType = <function> defined @Carbonite.Quests\NxQuest.lua:9689
PartyUpdateTimer = <function> defined @Carbonite.Quests\NxQuest.lua:10572
UnpackLocRect = <function> defined @Carbonite.Quests\NxQuest.lua:10685
UnpackObjectiveNew = <function> defined @Carbonite.Quests\NxQuest.lua:10674
PartySendTimer = <function> defined @Carbonite.Quests\NxQuest.lua:10652
MapChanged = <function> defined @Carbonite.Quests\NxQuest.lua:3590
PartyBuildSendData = <function> defined @Carbonite.Quests\NxQuest.lua:10590
PartyStartSend = <function> defined @Carbonite.Quests\NxQuest.lua:10579
OnPartyMsg = <function> defined @Carbonite.Quests\NxQuest.lua:10504
OnParty_members_changed = <func


example of API ipairs from http://www.wowwiki.com/API_ipairs

Note that ipairs() starts at index 1 and stops counting as soon as it reaches a nil value. Example:

> t = { [0] = "zero", --will not be counted
[1] = "one", --will be counted; 1
[2] = "two", --will be counted; 2
[3] = "three", --will be counted; 3
["four"] = "four", --will not be counted; returns 3
[5] = "five" } --will never be reached
> for i,v in ipairs(t) do print(i..":"..v) end
1: one
2: two
3: three

Note that t[0] is never reached because it starts counting at [1], t["four"] is never reached because it is not an array index, and t[5] is never reached because the iterator ceases when it checks t[4] and finds a nil value.