fix: Guard against nil IdList in killcredit objective
This commit is contained in:
@@ -68,13 +68,15 @@ killcredit = function(npcId, objective, objectiveData)
|
|||||||
local foundValid = false
|
local foundValid = false
|
||||||
|
|
||||||
-- First pass: try all IDs in IdList
|
-- First pass: try all IDs in IdList
|
||||||
for npcIdIndex = 1, #objectiveData.IdList do
|
if objectiveData.IdList then
|
||||||
local killCreditNpcId = objectiveData.IdList[npcIdIndex]
|
for npcIdIndex = 1, #objectiveData.IdList do
|
||||||
if killCreditNpcId and killCreditNpcId > 0 then
|
local killCreditNpcId = objectiveData.IdList[npcIdIndex]
|
||||||
local monsterResult = monster(killCreditNpcId, objective)
|
if killCreditNpcId and killCreditNpcId > 0 then
|
||||||
if monsterResult then
|
local monsterResult = monster(killCreditNpcId, objective)
|
||||||
ret[killCreditNpcId] = monsterResult[killCreditNpcId]
|
if monsterResult then
|
||||||
foundValid = true
|
ret[killCreditNpcId] = monsterResult[killCreditNpcId]
|
||||||
|
foundValid = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user