mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
NKAI: reduce double army loss cases
This commit is contained in:
@ -89,7 +89,7 @@ void ClientCommandManager::handleGoSoloCommand()
|
||||
// unlikely it will work but just in case to be consistent
|
||||
for(auto & color : CSH->getAllClientPlayers(CSH->logicConnection->connectionID))
|
||||
{
|
||||
if(CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
|
||||
if(color.isValidPlayer() && CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
|
||||
{
|
||||
CSH->client->installNewPlayerInterface(std::make_shared<CPlayerInterface>(color), color);
|
||||
}
|
||||
@ -102,7 +102,7 @@ void ClientCommandManager::handleGoSoloCommand()
|
||||
|
||||
for(auto & color : CSH->getAllClientPlayers(CSH->logicConnection->connectionID))
|
||||
{
|
||||
if(CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
|
||||
if(color.isValidPlayer() && CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
|
||||
{
|
||||
auto AiToGive = CSH->client->aiNameForPlayer(*CSH->client->getPlayerSettings(color), false, false);
|
||||
printCommandMessage("Player " + color.toString() + " will be lead by " + AiToGive, ELogLevel::INFO);
|
||||
|
Reference in New Issue
Block a user