mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix: 'Restart Scenario' button should work properly
This commit is contained in:
		| @@ -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)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user