|
@@ -42,7 +42,6 @@
|
|
|
#include "../lib/GameConstants.h"
|
|
|
#include "gui/CGuiHandler.h"
|
|
|
#include "../lib/logging/CBasicLogConfigurator.h"
|
|
|
-#include "../lib/CondSh.h"
|
|
|
#include "../lib/StringConstants.h"
|
|
|
#include "../lib/CPlayerState.h"
|
|
|
#include "gui/CAnimation.h"
|
|
@@ -90,6 +89,7 @@ std::queue<SDL_Event> events;
|
|
|
boost::mutex eventsM;
|
|
|
|
|
|
bool gNoGUI = false;
|
|
|
+CondSh<bool> serverAlive(false);
|
|
|
static po::variables_map vm;
|
|
|
|
|
|
//static bool setResolution = false; //set by event handling thread after resolution is adjusted
|
|
@@ -1171,13 +1171,14 @@ static void handleEvent(SDL_Event & ev)
|
|
|
case RETURN_TO_MAIN_MENU:
|
|
|
{
|
|
|
endGame();
|
|
|
- GH.curInt = CGPreGame::create();;
|
|
|
+ GH.curInt = CGPreGame::create();
|
|
|
GH.defActionsDef = 63;
|
|
|
}
|
|
|
break;
|
|
|
case RESTART_GAME:
|
|
|
{
|
|
|
StartInfo si = *client->getStartInfo(true);
|
|
|
+ si.seedToBeUsed = 0; //server gives new random generator seed if 0
|
|
|
endGame();
|
|
|
startGame(&si);
|
|
|
}
|
|
@@ -1248,6 +1249,9 @@ static void mainLoop()
|
|
|
|
|
|
void startGame(StartInfo * options, CConnection *serv/* = nullptr*/)
|
|
|
{
|
|
|
+ serverAlive.waitWhileTrue();
|
|
|
+ serverAlive.setn(true);
|
|
|
+
|
|
|
if(vm.count("onlyAI"))
|
|
|
{
|
|
|
auto ais = vm.count("ai") ? vm["ai"].as<std::vector<std::string>>() : std::vector<std::string>();
|