From cc5dbd467e694c2d330823caf9d4082919d752f5 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Wed, 6 Jul 2011 22:35:35 +0000 Subject: [PATCH] maxUnitCount respected by spawn attack --- source/glest_game/world/unit_updater.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 86116ff14..1625d22b6 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: