From 6dbb62cafa4c1c6211f4714bceddb37fa42804c0 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Sun, 4 Mar 2018 12:02:45 -0600 Subject: [PATCH] menu_state_custom_game.cpp:when slots open, switch to British With enhanced observer mode, When a map is changed from 8 players to 4, this switches factions 5-8 from Observer to British (used faction "0" for the default, which translates to British in this situation) and allows teams to be changed. --- .../glest_game/menu/menu_state_custom_game.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 494d712eb..b4b1ad63e 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -4370,10 +4370,6 @@ namespace Glest for (int i = 0; i < GameConstants::maxPlayers; ++i) { - // FIXME: The contents of this if block could be refactored; - // Some of same statements are used in each condtion. - // please test afteward. - // if (i >= mapInfo.hardMaxPlayers) { if (checkBoxAllowObservers.getValue() == false) @@ -4381,8 +4377,6 @@ namespace Glest listBoxControls[i].setSelectedItemIndex (ctClosed); listBoxControls[i].setEditable (false); listBoxControls[i].setEnabled (false); - listBoxRMultiplier[i].setEditable (false); - listBoxRMultiplier[i].setEnabled (false); } else { @@ -4393,10 +4387,11 @@ namespace Glest listBoxTeams[i].setSelectedItem (intToStr (GameConstants::maxPlayers + fpt_Observer)); listBoxTeams[i].setEditable (false); - listBoxRMultiplier[i].setEditable (false); - listBoxRMultiplier[i].setEnabled (false); - listBoxRMultiplier[i].setVisible (false); } + + listBoxRMultiplier[i].setEditable (false); + listBoxRMultiplier[i].setEnabled (false); + listBoxRMultiplier[i].setVisible (false); } else if (listBoxControls[i].getSelectedItemIndex () != ctNetworkUnassigned) @@ -4412,6 +4407,7 @@ namespace Glest listBoxControls[i].setEnabled (true); listBoxFactions[i].setEditable (true); listBoxTeams[i].setEditable (true); + listBoxFactions[i].setSelectedItemIndex (0); } else { @@ -4441,7 +4437,7 @@ namespace Glest } while (++i < GameConstants::maxPlayers); } - updateNetworkSlots (); + // updateNetworkSlots (); bool checkDataSynch = (serverInterface->getAllowGameDataSynchCheck () == true