From 49eec164019feecef185659c32c278980ef723cc Mon Sep 17 00:00:00 2001 From: titiger Date: Thu, 30 Oct 2014 00:02:23 +0100 Subject: [PATCH] disable factioncontrol selection where it is not possible --- source/glest_game/menu/menu_state_connected_game.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 4abc8123..7ad4cf14 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -2868,7 +2868,16 @@ void MenuStateConnectedGame::update() { if(isHeadlessAdmin() == true) { for(unsigned int i = 0; i < (unsigned int)GameConstants::maxPlayers; ++i) { - listBoxControls[i].setEditable(isHeadlessAdmin()); + if(displayedGamesettings.getFactionControl(i)==ctNetwork && + displayedGamesettings.getNetworkPlayerNameByPlayerIndex(i)!= GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME){ + listBoxControls[i].setEditable(false); + } + else + if(clientInterface->getPlayerIndex()==(int)i) + listBoxControls[i].setEditable(false); + else { + listBoxControls[i].setEditable(true); + } listBoxRMultiplier[i].setEditable(isHeadlessAdmin()); listBoxFactions[i].setEditable(isHeadlessAdmin()); listBoxTeams[i].setEditable(isHeadlessAdmin());