MaxUnitCount did not work correctly for buildings

Buildings in state 'beeing build' were not taken into account. this is
fixed now.
This commit is contained in:
titiger 2020-12-09 01:46:56 +01:00
parent 6bb687e5cc
commit 5b9f28f21c
1 changed files with 1 additions and 1 deletions

View File

@ -952,7 +952,7 @@ int Faction::getCountForMaxUnitCount(const UnitType *unitType) const{
for(int j=0; j<getUnitCount(); ++j){
Unit *unit= getUnit(j);
const UnitType *currentUt= unit->getType();
if(unitType==currentUt && unit->isOperative()){
if(unitType==currentUt && ( unit->isAlive())){
count++;
}
//check if there is any command active which already produces this unit