- bugfix to disallow CPU players to be observers
- spelling mistake fix in error message
This commit is contained in:
parent
90d4072646
commit
ed90d620b3
|
@ -664,7 +664,7 @@ Command* Commander::buildCommand(const NetworkCommand* networkCommand) const {
|
|||
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
||||
if(gameNetworkInterface != NULL) {
|
||||
char szMsg[1024]="";
|
||||
sprintf(szMsg,"Player detected an error: Unit / Faction mismatch for unitId: %d, Local faction index = %d, remote idnex = %d. Game out of synch.",networkCommand->getUnitId(),unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex());
|
||||
sprintf(szMsg,"Player detected an error: Unit / Faction mismatch for unitId: %d, Local faction index = %d, remote index = %d. Game out of synch.",networkCommand->getUnitId(),unit->getFaction()->getIndex(),networkCommand->getUnitFactionIndex());
|
||||
gameNetworkInterface->sendTextMessage(szMsg,-1, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -857,6 +857,16 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||
}
|
||||
else if(listBoxFactions[i].mouseClick(x, y)) {
|
||||
|
||||
//printf("factionFiles[listBoxFactions[i].getSelectedItemIndex()] [%s] i = %d selIndex = %d\n",factionFiles[listBoxFactions[i].getSelectedItemIndex()].c_str(),i,listBoxFactions[i].getSelectedItemIndex());
|
||||
|
||||
// Disallow CPU players to be observers
|
||||
if(factionFiles[listBoxFactions[i].getSelectedItemIndex()] == formatString(GameConstants::OBSERVER_SLOTNAME) &&
|
||||
(listBoxControls[i].getSelectedItemIndex() == ctCpuEasy || listBoxControls[i].getSelectedItemIndex() == ctCpu ||
|
||||
listBoxControls[i].getSelectedItemIndex() == ctCpuUltra || listBoxControls[i].getSelectedItemIndex() == ctCpuMega)) {
|
||||
listBoxFactions[i].setSelectedItemIndex(0);
|
||||
}
|
||||
//
|
||||
|
||||
if(listBoxPublishServer.getSelectedItemIndex() == 0) {
|
||||
needToRepublishToMasterserver = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue