Core/Entities: Replace Unit::canAttack usage with more accurate Unit::IsValidAttackTarget

This commit is contained in:
QAston
2011-09-16 23:49:31 +02:00
parent 3a3f2d927f
commit c0b1823524
15 changed files with 23 additions and 19 deletions
@@ -45,7 +45,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data)
return;
}
if (!_player->canAttack(pEnemy))
if (!_player->IsValidAttackTarget(pEnemy))
{
// stop attack state at client
SendAttackStop(pEnemy);
@@ -191,7 +191,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
return;
if (Unit* owner = pet->GetOwner())
if (!owner->canAttack(TargetUnit))
if (!owner->IsValidAttackTarget(TargetUnit))
return;
// Not let attack through obstructions