|  | @@ -39,6 +39,7 @@
 | 
	
		
			
				|  |  |  #include "../lib/VCMIDirs.h"
 | 
	
		
			
				|  |  |  #include "../lib/logging/VisualLogger.h"
 | 
	
		
			
				|  |  |  #include "CMT.h"
 | 
	
		
			
				|  |  | +#include "../lib/serializer/Connection.h"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  #ifdef SCRIPTING_ENABLED
 | 
	
		
			
				|  |  |  #include "../lib/ScriptHandler.h"
 | 
	
	
		
			
				|  | @@ -82,31 +83,37 @@ void ClientCommandManager::handleGoSoloCommand()
 | 
	
		
			
				|  |  |  		printCommandMessage("Game is not in playing state");
 | 
	
		
			
				|  |  |  		return;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | -	PlayerColor color;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	if(session["aiSolo"].Bool())
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -		for(auto & elem : CSH->client->gameState()->players)
 | 
	
		
			
				|  |  | +		// unlikely it will work but just in case to be consistent
 | 
	
		
			
				|  |  | +		for(auto & color : CSH->getAllClientPlayers(CSH->logicConnection->connectionID))
 | 
	
		
			
				|  |  |  		{
 | 
	
		
			
				|  |  | -			if(elem.second.human)
 | 
	
		
			
				|  |  | -				CSH->client->installNewPlayerInterface(std::make_shared<CPlayerInterface>(elem.first), elem.first);
 | 
	
		
			
				|  |  | +			if(CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
 | 
	
		
			
				|  |  | +			{
 | 
	
		
			
				|  |  | +				CSH->client->installNewPlayerInterface(std::make_shared<CPlayerInterface>(color), color);
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	else
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -		color = LOCPLINT->playerID;
 | 
	
		
			
				|  |  | +		PlayerColor currentColor = LOCPLINT->playerID;
 | 
	
		
			
				|  |  |  		CSH->client->removeGUI();
 | 
	
		
			
				|  |  | -		for(auto & elem : CSH->client->gameState()->players)
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		for(auto & color : CSH->getAllClientPlayers(CSH->logicConnection->connectionID))
 | 
	
		
			
				|  |  |  		{
 | 
	
		
			
				|  |  | -			if(elem.second.human)
 | 
	
		
			
				|  |  | +			if(CSH->client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
 | 
	
		
			
				|  |  |  			{
 | 
	
		
			
				|  |  | -				auto AiToGive = CSH->client->aiNameForPlayer(*CSH->client->getPlayerSettings(elem.first), false, false);
 | 
	
		
			
				|  |  | -				printCommandMessage("Player " + elem.first.toString() + " will be lead by " + AiToGive, ELogLevel::INFO);
 | 
	
		
			
				|  |  | -				CSH->client->installNewPlayerInterface(CDynLibHandler::getNewAI(AiToGive), elem.first);
 | 
	
		
			
				|  |  | +				auto AiToGive = CSH->client->aiNameForPlayer(*CSH->client->getPlayerSettings(color), false, false);
 | 
	
		
			
				|  |  | +				printCommandMessage("Player " + color.toString() + " will be lead by " + AiToGive, ELogLevel::INFO);
 | 
	
		
			
				|  |  | +				CSH->client->installNewPlayerInterface(CDynLibHandler::getNewAI(AiToGive), color);
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		GH.windows().totalRedraw();
 | 
	
		
			
				|  |  | -		giveTurn(color);
 | 
	
		
			
				|  |  | +		giveTurn(currentColor);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	session["aiSolo"].Bool() = !session["aiSolo"].Bool();
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 |