maxUnitCount respected by spawn attack

This commit is contained in:
Titus Tscharntke 2011-07-06 22:35:35 +00:00
parent 1b2d4fddea
commit cc5dbd467e
1 changed files with 5 additions and 0 deletions

View File

@ -176,6 +176,11 @@ void UnitUpdater::updateUnit(Unit *unit) {
const UnitType *spawnUnitType = ft->getUnitType(act->getAttackSkillType()->getSpawnUnit());
int spawnCount = act->getAttackSkillType()->getSpawnUnitCount();
for (int y=0; y < spawnCount; ++y) {
if(spawnUnitType->getMaxUnitCount() > 0) {
if(spawnUnitType->getMaxUnitCount() <= unit->getFaction()->getCountForMaxUnitCount(spawnUnitType)) {
break;
}
}
UnitPathInterface *newpath = NULL;
switch(this->game->getGameSettings()->getPathFinderType()) {
case pfBasic: