From 5b7e9cb966c45106ef68c578098ea0706b4ad23d Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 8 Mar 2013 08:47:14 +0100 Subject: [PATCH] More error check in CountPerson method --- DKCrutch.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 8248738..4809f8a 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -303,10 +303,10 @@ function DKCrutch:CountPerson(time, event, sguid, sname, sflags, dguid, dname, d local stype = 0; local dtype = 0; - if (sguid) then + if (sguid) and (sguid:sub(5,5)) and (tonumber(sguid:sub(5,5), 16)) then stype = (tonumber(sguid:sub(5,5), 16)) % 8; end - if (dguid) then + if (dguid) and (dguid:sub(5,5)) and (tonumber(dguid:sub(5,5), 16)) then dtype = (tonumber(dguid:sub(5,5), 16)) % 8; end if (bit.band(dflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and ((dtype==0) or (dtype==3)) then -- 1.7.9.5