Added input check in CUnitBase::TargetDistance.