mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
- attempt to fix issue where user can switch to an invalid slot in network game lobby
This commit is contained in:
@@ -931,7 +931,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
|
|
||||||
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork &&
|
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork &&
|
||||||
labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME) {
|
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);
|
//printf("Send slot switch request for slot = %d, myCurrentIndex = %d\n",i,myCurrentIndex);
|
||||||
|
|
||||||
soundRenderer.playFx(coreData.getClickSoundA());
|
soundRenderer.playFx(coreData.getClickSoundA());
|
||||||
@@ -1914,8 +1914,10 @@ void MenuStateConnectedGame::render() {
|
|||||||
|
|
||||||
if((listBoxControls[i].getSelectedItemIndex() == ctNetwork) &&
|
if((listBoxControls[i].getSelectedItemIndex() == ctNetwork) &&
|
||||||
(labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)) {
|
(labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)) {
|
||||||
|
if(i < mapInfo.players) {
|
||||||
renderer.renderButton(&grabSlotButton[i]);
|
renderer.renderButton(&grabSlotButton[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(listBoxControls[i].getSelectedItemIndex() == ctNetwork ||
|
else if(listBoxControls[i].getSelectedItemIndex() == ctNetwork ||
|
||||||
listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned ||
|
listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned ||
|
||||||
listBoxControls[i].getSelectedItemIndex() == ctHuman){
|
listBoxControls[i].getSelectedItemIndex() == ctHuman){
|
||||||
|
Reference in New Issue
Block a user