enemy targeting changed a bit again
This commit is contained in:
parent
c99fb68f5b
commit
4719686440
|
@ -561,6 +561,10 @@ void UnitUpdater::unitBeingAttacked(std::pair<bool,Unit *> &result, const Unit *
|
||||||
distToUnit = unit->getCenteredPos().dist(enemy->getCenteredPos());
|
distToUnit = unit->getCenteredPos().dist(enemy->getCenteredPos());
|
||||||
result.first = true;
|
result.first = true;
|
||||||
result.second = enemy;
|
result.second = enemy;
|
||||||
|
if( ast->getAttackRange()>=distToUnit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue