From 8e9aef2d09e99b111e3252edd0180f8d98ebf94f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 14 Nov 2011 05:44:43 +0000 Subject: [PATCH] - attempt to fix issue where user can switch to an invalid slot in network game lobby --- source/glest_game/menu/menu_state_connected_game.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 783c3dfd..916bf537 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -931,7 +931,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ if(listBoxControls[i].getSelectedItemIndex() == ctNetwork && labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME) { - if(grabSlotButton[i].mouseClick(x, y)) { + if(i < mapInfo.players && grabSlotButton[i].mouseClick(x, y)) { //printf("Send slot switch request for slot = %d, myCurrentIndex = %d\n",i,myCurrentIndex); soundRenderer.playFx(coreData.getClickSoundA()); @@ -1914,7 +1914,9 @@ void MenuStateConnectedGame::render() { if((listBoxControls[i].getSelectedItemIndex() == ctNetwork) && (labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)) { - renderer.renderButton(&grabSlotButton[i]); + if(i < mapInfo.players) { + renderer.renderButton(&grabSlotButton[i]); + } } else if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned ||