@@ -387,7 +387,10 @@ void PlayerSelection::initializeMap(bool relaunchedLobby)
387387 }
388388 else if (ai == GameEnums::AiTypes_Human)
389389 {
390- pPlayer->setPlayerNameId (Settings::getInstance ()->getUsername ());
390+ if (!Mainapp::getSlave ())
391+ {
392+ pPlayer->setPlayerNameId (Settings::getInstance ()->getUsername ());
393+ }
391394 }
392395 pPlayer->setControlType (ai);
393396 }
@@ -397,7 +400,10 @@ void PlayerSelection::initializeMap(bool relaunchedLobby)
397400 CONSOLE_PRINT (" PlayerSelection::initializeMap changing player " + QString::number (i) + " to human" , GameConsole::eDEBUG);
398401 pPlayer->setBaseGameInput (MemoryManagement::create<HumanPlayerInput>(m_pMap));
399402 pPlayer->setControlType (GameEnums::AiTypes_Human);
400- pPlayer->setPlayerNameId (Settings::getInstance ()->getUsername ());
403+ if (!Mainapp::getSlave ())
404+ {
405+ pPlayer->setPlayerNameId (Settings::getInstance ()->getUsername ());
406+ }
401407 }
402408 else
403409 {
@@ -437,7 +443,10 @@ void PlayerSelection::initializeMap(bool relaunchedLobby)
437443 const auto ai = GameEnums::AiTypes_Human;
438444 m_pMap->getPlayer (i)->setControlType (ai);
439445 m_pMap->getPlayer (i)->setBaseGameInput (BaseGameInputIF::createAi (m_pMap, m_pMap->getPlayer (i)->getControlType ()));
440- m_pMap->getPlayer (i)->setPlayerNameId (Settings::getInstance ()->getUsername ());
446+ if (!Mainapp::getSlave ())
447+ {
448+ m_pMap->getPlayer (i)->setPlayerNameId (Settings::getInstance ()->getUsername ());
449+ }
441450 }
442451 }
443452 }
@@ -449,7 +458,10 @@ void PlayerSelection::initializeMap(bool relaunchedLobby)
449458 m_pMap->getPlayer (i)->setBaseGameInput (BaseGameInputIF::createAi (m_pMap, controType));
450459 if (controType == GameEnums::AiTypes_Human)
451460 {
452- m_pMap->getPlayer (i)->setPlayerNameId (Settings::getInstance ()->getUsername ());
461+ if (!Mainapp::getSlave ())
462+ {
463+ m_pMap->getPlayer (i)->setPlayerNameId (Settings::getInstance ()->getUsername ());
464+ }
453465 }
454466 else if (controType <= GameEnums::AiTypes::AiTypes_ProxyAi)
455467 {
0 commit comments