mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Unit: Stop mobs and pets from agressing invisible targets - they can't fight what they can't see
This commit is contained in:
@@ -12108,6 +12108,9 @@ bool Unit::canAttack(Unit const* target, bool force) const
|
||||
if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
|
||||
return false;
|
||||
|
||||
if (!canSeeOrDetect(target))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user