1
0
Bifurcation 0

Handled case of ltype having a nil value in function Loot, by simply returning. Seems to only occur on item rolls. We continue to throw an error if ltype is not nil and has a non-number type.

Cette révision appartient à :
Nathanial.C.Jones 2010-10-25 00:11:00 +00:00
Parent 47cb8df6f6
révision 43574af33d
1 fichiers modifiés avec 9 ajouts et 1 suppressions

Voir le fichier

@ -143,7 +143,15 @@ local eventy = {}
local function Looted(message)
local ltype = GetItemType(message, true)
if type(ltype) ~= "number" then error(string.format("Expected a number but got a %s.", type(ltype)) .. "The value is:" .. ltype) end
-- Oddly, we get an ltype that has a nil value once in a while, so we ignore it and return.
-- Only seems to occur when rolling for something.
if ltype == nil then return end
-- Just in case...
if type(ltype) ~= "number" then
error(string.format("Expected a number but got a %s.", type(ltype)) .. "The value is:" .. ltype)
end
table.insert(eventy, {time = GetTime(), event = string.format("I%di", ltype)})
--if debug_output then QuestHelper:TextOut(string.format("Added event %s", string.format("I%di", ltype))) end
end