fix for the AI not respecting max-unit-count

This commit is contained in:
Titus Tscharntke
2010-10-04 19:21:09 +00:00
parent d38b46a529
commit 88335f112b

View File

@@ -1362,7 +1362,7 @@ CommandResult Unit::checkCommand(Command *command) const {
throw runtime_error(szBuf); throw runtime_error(szBuf);
} }
//if not operative or has not command type => fail //if not operative or has not command type => fail
if(!isOperative() || command->getUnit()==this || !getType()->hasCommandType(command->getCommandType())){ if(!isOperative() || command->getUnit()==this || !getType()->hasCommandType(command->getCommandType())|| !this->getFaction()->reqsOk(command->getCommandType())){
return crFailUndefined; return crFailUndefined;
} }