mirror of
https://github.com/glest/glest-source.git
synced 2025-09-08 23:10:42 +02:00
maxUnitCount respected by spawn attack
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user