Core/Entities: Replace Unit::canAttack usage with more accurate Unit::IsValidAttackTarget
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user