- attempt to fix issue where user can switch to an invalid slot in network game lobby

This commit is contained in:
Mark Vejvoda 2011-11-14 05:44:43 +00:00
parent 8050e25538
commit 8e9aef2d09
1 changed files with 4 additions and 2 deletions

View File

@ -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 ||