- bugfix for mixed up username when changing map and human player's slot is changed.
This commit is contained in:
parent
8bcca7080f
commit
b897611a6b
|
@ -2730,21 +2730,23 @@ void MenuStateCustomGame::reloadFactions(bool keepExistingSelectedItem) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateCustomGame::updateControlers(){
|
void MenuStateCustomGame::updateControlers() {
|
||||||
try {
|
try {
|
||||||
bool humanPlayer= false;
|
bool humanPlayer= false;
|
||||||
|
|
||||||
for(int i= 0; i<mapInfo.players; ++i){
|
for(int i = 0; i < mapInfo.players; ++i) {
|
||||||
if(listBoxControls[i].getSelectedItemIndex() == ctHuman){
|
if(listBoxControls[i].getSelectedItemIndex() == ctHuman) {
|
||||||
humanPlayer= true;
|
humanPlayer= true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!humanPlayer){
|
if(humanPlayer == false) {
|
||||||
listBoxControls[0].setSelectedItemIndex(ctHuman);
|
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);
|
listBoxControls[i].setSelectedItemIndex(ctClosed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue