mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 04:01:47 +02:00
no more error when blocker scenario does not exist
This commit is contained in:
@@ -106,15 +106,26 @@ void MenuStateNewGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||||||
}
|
}
|
||||||
else if(buttonMasterserverGame.mouseClick(x, y)){
|
else if(buttonMasterserverGame.mouseClick(x, y)){
|
||||||
soundRenderer.playFx(coreData.getClickSoundB());
|
soundRenderer.playFx(coreData.getClickSoundB());
|
||||||
|
bool playScenario=false;
|
||||||
if (Config::getInstance().getString("InternetGamesBlockScenario", "") != ""
|
if (Config::getInstance().getString("InternetGamesBlockScenario", "") != ""
|
||||||
&& Config::getInstance().getBool("InternetGamesAllowed", "false") == false) {
|
&& Config::getInstance().getBool("InternetGamesAllowed", "false") == false) {
|
||||||
mainMenu->setState(
|
|
||||||
new MenuStateScenario(program, mainMenu, false,
|
// check if scenario exists;
|
||||||
Config::getInstance().getPathListForType(
|
vector<string> dirList=Config::getInstance().getPathListForType(ptScenarios);
|
||||||
ptScenarios),
|
string scenarioName=Config::getInstance().getString(
|
||||||
Config::getInstance().getString(
|
"InternetGamesBlockScenario");
|
||||||
"InternetGamesBlockScenario")));
|
|
||||||
} else {
|
string scenarioPath = Scenario::getScenarioPath(dirList, scenarioName);
|
||||||
|
|
||||||
|
if (scenarioPath != "") {
|
||||||
|
mainMenu->setState(
|
||||||
|
new MenuStateScenario(program, mainMenu, false, dirList,
|
||||||
|
scenarioName));
|
||||||
|
playScenario=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(playScenario==false){
|
||||||
mainMenu->setState(new MenuStateMasterserver(program, mainMenu));
|
mainMenu->setState(new MenuStateMasterserver(program, mainMenu));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user