Core/Unit: Stop mobs and pets from agressing invisible targets - they can't fight what they can't see

This commit is contained in:
tobmaps
2011-05-12 21:05:22 +07:00
parent e7ff1196ed
commit 2feb30ec1b

View File

@@ -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;
}