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());
|
const UnitType *spawnUnitType = ft->getUnitType(act->getAttackSkillType()->getSpawnUnit());
|
||||||
int spawnCount = act->getAttackSkillType()->getSpawnUnitCount();
|
int spawnCount = act->getAttackSkillType()->getSpawnUnitCount();
|
||||||
for (int y=0; y < spawnCount; ++y) {
|
for (int y=0; y < spawnCount; ++y) {
|
||||||
|
if(spawnUnitType->getMaxUnitCount() > 0) {
|
||||||
|
if(spawnUnitType->getMaxUnitCount() <= unit->getFaction()->getCountForMaxUnitCount(spawnUnitType)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
UnitPathInterface *newpath = NULL;
|
UnitPathInterface *newpath = NULL;
|
||||||
switch(this->game->getGameSettings()->getPathFinderType()) {
|
switch(this->game->getGameSettings()->getPathFinderType()) {
|
||||||
case pfBasic:
|
case pfBasic:
|
||||||
|
|
Loading…
Reference in New Issue