public void setTargetUnit(Unit target) { if (target == null) // If we are unsetting the target (moving around) { if (targetUnit != null) // and we had a target { targetUnit.setDistressCall(null); // Unset the distress call } // TODO: Replace this with a delay? } else { target.setDistressCall(this); // Otherwise set the distress call } targetUnit = target; refreshWaypoints(); }
public void setTargetUnit(Unit target) { if (target == null) // If we are unsetting the target (moving around) { if (targetUnit != null) // and we had a target targetUnit.setDistressCall(null); // Unset the distress call // TODO: Replace this with a delay? } else { target.setDistressCall(this); // Otherwise set the distress call } targetUnit = target; refreshWaypoints(); }