First part of petAI logic cleanup : Hunter PetAI change: Ignore attacking CC'ed targets unless explicitly asked for by player

(thanks to QAston, Shauren, Liberate for the discussions and codehelp to sort this out properly)

--HG--
branch : trunk
This commit is contained in:
click
2010-07-28 19:39:56 +02:00
parent c173e84f25
commit c595eb8ae9
4 changed files with 30 additions and 15 deletions
+2 -2
View File
@@ -4625,13 +4625,13 @@ bool Unit::HasAuraTypeWithValue(AuraType auratype, int32 value) const
return false;
}
bool Unit::HasNegativeAuraWithInterruptFlag(uint32 flag)
bool Unit::HasNegativeAuraWithInterruptFlag(uint32 flag, uint64 guid)
{
if (!(m_interruptMask & flag))
return false;
for (AuraApplicationList::iterator iter = m_interruptableAuras.begin(); iter != m_interruptableAuras.end(); ++iter)
{
if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellProto()->AuraInterruptFlags & flag)
if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellProto()->AuraInterruptFlags & flag && (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
return true;
}
return false;