From 6f9f2d8f01d4f8209c57f1a233cc8193b2666a7a Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 6 Jul 2012 18:57:19 +0000 Subject: [PATCH] - allow admin user to switch slots when they are in an unassigned slot --- source/glest_game/menu/menu_state_custom_game.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index e3b6b5371..88e5faad0 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1970,12 +1970,14 @@ void MenuStateCustomGame::switchSetupForSlots(SwitchSetupRequest **switchSetupRe ServerInterface *& serverInterface, int startIndex, int endIndex, bool onlyNetworkUnassigned) { for(int i= startIndex; i < endIndex; ++i) { if(switchSetupRequests[i] != NULL) { - //printf("Switch slot = %d control = %d newIndex = %d currentindex = %d\n",i,listBoxControls[i].getSelectedItemIndex(),switchSetupRequests[i]->getToFactionIndex(),switchSetupRequests[i]->getCurrentFactionIndex()); + printf("Switch slot = %d control = %d newIndex = %d currentindex = %d onlyNetworkUnassigned = %d\n",i,listBoxControls[i].getSelectedItemIndex(),switchSetupRequests[i]->getToFactionIndex(),switchSetupRequests[i]->getCurrentFactionIndex(),onlyNetworkUnassigned); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] switchSetupRequests[i]->getSwitchFlags() = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,switchSetupRequests[i]->getSwitchFlags()); if(onlyNetworkUnassigned == true && listBoxControls[i].getSelectedItemIndex() != ctNetworkUnassigned) { - continue; + if(i < mapInfo.players || (i >= mapInfo.players && listBoxControls[i].getSelectedItemIndex() != ctNetwork)) { + continue; + } } if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {