1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00
This commit is contained in:
Andrii Danylchenko
2024-04-27 13:57:50 +03:00
parent 2ead852f09
commit 39e19f79f4
3 changed files with 26 additions and 7 deletions

View File

@ -136,8 +136,9 @@ void ClientCommandManager::handleControlaiCommand(std::istringstream& singleWord
for(auto & elem : CSH->client->gameState()->players)
{
if(elem.second.human ||
(colorName.length() && elem.first.getNum() != vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, colorName)))
if(!elem.first.isValidPlayer()
|| elem.second.human
|| (colorName.length() && elem.first.getNum() != vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, colorName)))
{
continue;
}