diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 86116ff1..1625d22b 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -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: