mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 01:44:23 +02:00
- bugfix, only allow changing player info AFTER we get game settings from the server after requesting a change to avoid deadlocks etc.
This commit is contained in:
@@ -197,7 +197,11 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
currentMap="";
|
currentMap="";
|
||||||
returnToJoinMenu();
|
returnToJoinMenu();
|
||||||
}
|
}
|
||||||
else if(buttonPlayNow.mouseClick(x,y) && buttonPlayNow.getEnabled()) {
|
|
||||||
|
// Only allow changes after we get game settings from the server
|
||||||
|
if( clientInterface->isConnected() == true &&
|
||||||
|
clientInterface->getGameSettingsReceived() == true) {
|
||||||
|
if(buttonPlayNow.mouseClick(x,y) && buttonPlayNow.getEnabled()) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
soundRenderer.playFx(coreData.getClickSoundC());
|
soundRenderer.playFx(coreData.getClickSoundC());
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
@@ -248,61 +252,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// for(int i=0; i<mapInfo.players; ++i)
|
|
||||||
// {
|
|
||||||
// //ensure thet only 1 human player is present
|
|
||||||
// if(listBoxControls[i].mouseClick(x, y))
|
|
||||||
// {
|
|
||||||
// //look for human players
|
|
||||||
// int humanIndex1= -1;
|
|
||||||
// int humanIndex2= -1;
|
|
||||||
// for(int j=0; j<GameConstants::maxPlayers; ++j){
|
|
||||||
// ControlType ct= static_cast<ControlType>(listBoxControls[j].getSelectedItemIndex());
|
|
||||||
// if(ct==ctHuman){
|
|
||||||
// if(humanIndex1==-1){
|
|
||||||
// humanIndex1= j;
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// humanIndex2= j;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //no human
|
|
||||||
// if(humanIndex1==-1 && humanIndex2==-1){
|
|
||||||
// listBoxControls[i].setSelectedItemIndex(ctHuman);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //2 humans
|
|
||||||
// if(humanIndex1!=-1 && humanIndex2!=-1){
|
|
||||||
// listBoxControls[humanIndex1==i? humanIndex2: humanIndex1].setSelectedItemIndex(ctClosed);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if(hasNetworkGameSettings() == true)
|
|
||||||
// {
|
|
||||||
// needToSetChangedGameSettings = true;
|
|
||||||
// lastSetChangedGameSettings = time(NULL);;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else if(listBoxFactions[i].mouseClick(x, y)){
|
|
||||||
//
|
|
||||||
// if(hasNetworkGameSettings() == true)
|
|
||||||
// {
|
|
||||||
// needToSetChangedGameSettings = true;
|
|
||||||
// lastSetChangedGameSettings = time(NULL);;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else if(listBoxTeams[i].mouseClick(x, y))
|
|
||||||
// {
|
|
||||||
// if(hasNetworkGameSettings() == true)
|
|
||||||
// {
|
|
||||||
// needToSetChangedGameSettings = true;
|
|
||||||
// lastSetChangedGameSettings = time(NULL);;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user