maxUnitCount respected by spawn attack
This commit is contained in:
parent
1b2d4fddea
commit
cc5dbd467e
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue