mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix: 'Restart Scenario' button should work properly
This commit is contained in:
parent
98fdf909e8
commit
3add3156e2
@ -451,6 +451,13 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const
|
||||
{
|
||||
verifyStateBeforeStart(allowOnlyAI ? true : settings["session"]["onlyai"].Bool());
|
||||
LobbyStartGame lsg;
|
||||
if(client)
|
||||
{
|
||||
lsg.initializedStartInfo = std::make_shared<StartInfo>(* const_cast<StartInfo *>(client->getStartInfo(true)));
|
||||
lsg.initializedStartInfo->mode = StartInfo::NEW_GAME;
|
||||
lsg.initializedStartInfo->seedToBeUsed = lsg.initializedStartInfo->seedPostInit = 0;
|
||||
* si = * lsg.initializedStartInfo;
|
||||
}
|
||||
sendLobbyPack(lsg);
|
||||
}
|
||||
|
||||
|
@ -228,6 +228,8 @@ void CVCMIServer::prepareToStartGame()
|
||||
if(state == EServerState::GAMEPLAY)
|
||||
{
|
||||
restartGameplay = true;
|
||||
* si = * gh->gs->initialOpts;
|
||||
si->seedToBeUsed = si->seedPostInit = 0;
|
||||
state = EServerState::LOBBY;
|
||||
// FIXME: dirry hack to make sure old CGameHandler::run is finished
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
|
||||
|
Loading…
Reference in New Issue
Block a user