diff --git a/src/Unit.cpp b/src/Unit.cpp index 0bb94a9784e987fff2898534f944bc8018e7b816..d20d062fbec106b034d17c2f6fd53aa179be8d0e 100644 --- a/src/Unit.cpp +++ b/src/Unit.cpp @@ -328,7 +328,9 @@ void Unit::ability(sc2::AbilityID ability, const Unit& target) const Unit Unit::getTarget() const { BOT_ASSERT(isValid(), "Unit is not valid"); - BOT_ASSERT(hasTarget(), "Unit has no target"); + if (!hasTarget()){ + return NULL + } // if unit has order, check tag of target of first order if(getUnitPtr()->orders.size() > 0){