mirror of
https://github.com/glest/glest-source.git
synced 2025-02-26 12:43:06 +01:00
- bugfix to close empty slots on game start
This commit is contained in:
parent
7a6e937133
commit
b8a8e3b519
@ -1185,7 +1185,7 @@ void MenuStateCustomGame::PlayNow() {
|
||||
|
||||
safeMutex.ReleaseLock(true);
|
||||
GameSettings gameSettings;
|
||||
loadGameSettings(&gameSettings);
|
||||
loadGameSettings(&gameSettings, true);
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
|
||||
@ -2272,7 +2272,7 @@ void MenuStateCustomGame::simpleTask(BaseThread *callingThread) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings) {
|
||||
void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool forceCloseUnusedSlots) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
int factionCount= 0;
|
||||
@ -2316,6 +2316,17 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings) {
|
||||
int AIPlayerCount = 0;
|
||||
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
||||
ControlType ct= static_cast<ControlType>(listBoxControls[i].getSelectedItemIndex());
|
||||
|
||||
if(forceCloseUnusedSlots == true && (ct == ctNetworkUnassigned || ct == ctNetwork)) {
|
||||
if(serverInterface->getSlot(i) == NULL ||
|
||||
serverInterface->getSlot(i)->isConnected() == false) {
|
||||
//printf("Closed A [%d] [%s]\n",i,labelPlayerNames[i].getText().c_str());
|
||||
|
||||
listBoxControls[i].setSelectedItemIndex(ctClosed);
|
||||
ct = ctClosed;
|
||||
}
|
||||
}
|
||||
|
||||
if(ct != ctClosed) {
|
||||
int slotIndex = factionCount;
|
||||
|
||||
|
@ -181,7 +181,7 @@ public:
|
||||
private:
|
||||
|
||||
bool hasNetworkGameSettings();
|
||||
void loadGameSettings(GameSettings *gameSettings);
|
||||
void loadGameSettings(GameSettings *gameSettings, bool forceCloseUnusedSlots=false);
|
||||
void loadMapInfo(string file, MapInfo *mapInfo,bool loadMapPreview);
|
||||
void cleanupMapPreviewTexture();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user