- bugfix for mixed up username when changing map and human player's slot is changed.

This commit is contained in:
Mark Vejvoda 2011-04-14 16:04:42 +00:00
parent 8bcca7080f
commit b897611a6b
1 changed files with 7 additions and 5 deletions

View File

@ -2730,21 +2730,23 @@ void MenuStateCustomGame::reloadFactions(bool keepExistingSelectedItem) {
}
}
void MenuStateCustomGame::updateControlers(){
void MenuStateCustomGame::updateControlers() {
try {
bool humanPlayer= false;
for(int i= 0; i<mapInfo.players; ++i){
if(listBoxControls[i].getSelectedItemIndex() == ctHuman){
for(int i = 0; i < mapInfo.players; ++i) {
if(listBoxControls[i].getSelectedItemIndex() == ctHuman) {
humanPlayer= true;
}
}
if(!humanPlayer){
if(humanPlayer == false) {
listBoxControls[0].setSelectedItemIndex(ctHuman);
labelPlayerNames[0].setText("");
labelPlayerNames[0].setText(getHumanPlayerName());
}
for(int i= mapInfo.players; i<GameConstants::maxPlayers; ++i){
for(int i= mapInfo.players; i < GameConstants::maxPlayers; ++i) {
listBoxControls[i].setSelectedItemIndex(ctClosed);
}
}