From b4a6f56b942c7554c14959bb20455ddfd1005b84 Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 8 Mar 2013 08:21:26 +0100 Subject: [PATCH] Fixes in CountPerson method. --- DKCrutch.lua | 15 +++++++++++---- DKCrutch.toc | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index e3d3924..8248738 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.8.0 +-- DKCrutch 0.8.1 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.8.0' +DKCrutch.versionNumber = '0.8.1' DKCrutch.talent = "" DKCrutch.talentUnsure = true DKCrutch.DebugMode = false @@ -300,8 +300,15 @@ end function DKCrutch:CountPerson(time, event, sguid, sname, sflags, dguid, dname, dflags) local suffix = event:match(".+(_.-)$") if DKCrutch.HostileFilter[suffix] then - local stype = (tonumber(sguid:sub(5,5), 16)) % 8 - local dtype = (tonumber(dguid:sub(5,5), 16)) % 8 + local stype = 0; + local dtype = 0; + + if (sguid) then + stype = (tonumber(sguid:sub(5,5), 16)) % 8; + end + if (dguid) 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 if ((not DKCrutch.person["foe"][dguid]) or (DKCrutch.person["foe"][dguid]==0)) then DKCrutch.person["foeCount"] = DKCrutch.person["foeCount"] + 1 diff --git a/DKCrutch.toc b/DKCrutch.toc index 84eb8db..acfb56e 100755 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -2,7 +2,7 @@ ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 0.8.0 +## Version: 0.8.1 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: -- 1.7.9.5