More error check in CountPerson method
Taracque [03-08-13 - 07:47]
More error check in CountPerson method
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