From 8d7221e643ffb315aecc32a9999718a03fbe2550 Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 20 May 2011 00:56:17 +0200 Subject: [PATCH] Friend and foe detection rewriten, hopefully works much better now. --- Elementarist.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Elementarist.lua b/Elementarist.lua index 4a0d233..c4ef3b5 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -331,23 +331,23 @@ function Elementarist:CountPerson(time, event, sguid, sname, sflags, dguid, dnam local stype = (tonumber(sguid:sub(5,5), 16)) % 8 local dtype = (tonumber(dguid:sub(5,5), 16)) % 8 if Elementarist.HostileFilter[suffix] then - if (bit.band(sflags, COMBATLOG_OBJECT_AFFILIATION_MASK) < 8) and ((dtype==0) or (dtype==3)) then + if (bit.band(sflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(sflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and ((dtype==0) or (dtype==3)) then if ((not Elementarist.person["foe"][dguid]) or (Elementarist.person["foe"][dguid]==0)) then Elementarist.person["foeCount"] = Elementarist.person["foeCount"] + 1 end Elementarist.person["foe"][dguid] = time - elseif (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_MASK) < 8) and ((stype==0) or (stype==3)) then + elseif (bit.band(dflags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE) and (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) == COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) and ((stype==0) or (stype==3)) then if ((not Elementarist.person["foe"][sguid]) or (Elementarist.person["foe"][sguid]==0)) then Elementarist.person["foeCount"] = Elementarist.person["foeCount"] + 1 end Elementarist.person["foe"][sguid] = time end - if (bit.band(sflags, COMBATLOG_OBJECT_AFFILIATION_MASK) >= 8) and ((dtype==0) or (dtype==3)) then + if (bit.band(sflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and ((dtype==0) or (dtype==3)) then if ((not Elementarist.person["friend"][dguid]) or (Elementarist.person["friend"][dguid]==0)) then Elementarist.person["friendCount"] = Elementarist.person["friendCount"] + 1 end Elementarist.person["friend"][dguid] = time - elseif (bit.band(dflags, COMBATLOG_OBJECT_AFFILIATION_MASK) >= 8) and ((stype==0) or (stype==3)) then + elseif (bit.band(dflags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY) and ((stype==0) or (stype==3)) then if ((not Elementarist.person["friend"][sguid]) or (Elementarist.person["friend"][sguid]==0)) then Elementarist.person["friendCount"] = Elementarist.person["friendCount"] + 1 end -- 1.7.9.5