Returns whether a unit can be inspected. Returns nil if the unit is out of inspect range, if the unit is an NPC, or if the unit is flagged for PvP combat and hostile to the player.


See also Inspect functions, Unit functions.

Signature:

canInspect = CanInspect("unit", showError)

Arguments:

  • unit - A unit to inspect (string, unitID)
  • showError - True to fire a UI_ERROR_MESSAGE event (causing the default UI to display an error message) if the unit cannot be inspected; otherwise false (boolean)

Returns:

  • canInspect - 1 if the unit can be inspected; otherwise nil (1nil)