*Fix the bug that Elemental Invisibility causes the creatures to constantly evade. Thanks to XTElite1 and simon

--HG--
branch : trunk
This commit is contained in:
megamage
2009-09-02 15:15:34 -05:00
parent 85ab4599ee
commit f49754447b
+3 -1
View File
@@ -10597,7 +10597,9 @@ bool Unit::canAttack(Unit const* target, bool force) const
if(!target->isAttackableByAOE() || target->hasUnitState(UNIT_STAT_DIED)) if(!target->isAttackableByAOE() || target->hasUnitState(UNIT_STAT_DIED))
return false; return false;
if((m_invisibilityMask || target->m_invisibilityMask) && !canDetectInvisibilityOf(target)) // shaman totem quests: spell 8898, shaman can detect elementals but elementals cannot see shaman
if(m_invisibilityMask || target->m_invisibilityMask)
if(!canDetectInvisibilityOf(target) && !target->canDetectInvisibilityOf(target))
return false; return false;
if(target->GetVisibility() == VISIBILITY_GROUP_STEALTH && !canDetectStealthOf(target, GetDistance(target))) if(target->GetVisibility() == VISIBILITY_GROUP_STEALTH && !canDetectStealthOf(target, GetDistance(target)))