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))
|
if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!canSeeOrDetect(target))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user