diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index da1345b2f..e1239004f 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -3178,6 +3178,12 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force if(ct != ctClosed) { int slotIndex = factionCount; + + if (ct == ctHuman && this->headlessServerMode == true) { + // switch slot to network, because no human in headless mode + ct = ctNetwork; + } + gameSettings->setFactionControl(slotIndex, ct); if(ct == ctHuman) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, slotIndex = %d, getHumanPlayerName(i) [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i,slotIndex,getHumanPlayerName(i).c_str()); @@ -3218,7 +3224,6 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex()); gameSettings->setStartLocationIndex(slotIndex, i); - if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) { if(serverInterface->getSlot(i) != NULL && serverInterface->getSlot(i)->isConnected()) {