fix: Guard against nil IdList in killcredit objective
This commit is contained in:
@@ -68,6 +68,7 @@ killcredit = function(npcId, objective, objectiveData)
|
||||
local foundValid = false
|
||||
|
||||
-- First pass: try all IDs in IdList
|
||||
if objectiveData.IdList then
|
||||
for npcIdIndex = 1, #objectiveData.IdList do
|
||||
local killCreditNpcId = objectiveData.IdList[npcIdIndex]
|
||||
if killCreditNpcId and killCreditNpcId > 0 then
|
||||
@@ -78,6 +79,7 @@ killcredit = function(npcId, objective, objectiveData)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Second pass: if no valid NPCs found, try name-based lookup from objective description
|
||||
-- This helps custom server quests where IdList may have 0 or wrong IDs
|
||||
|
||||
Reference in New Issue
Block a user