Changeset - r13168:7095f6d86716
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-10-03 14:48:12
rubidium@openttd.org
(svn r17685) -Fix: autounpausing kept trying to unpause a loaded game that was paused due to an error. Just reject such savegames in dedicated servers.
2 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/network.cpp
Show inline comments
 
@@ -364,13 +364,13 @@ static uint NetworkCountActiveClients()
 
	return count;
 
}
 

	
 
/* Check if the minimum number of active clients has been reached and pause or unpause the game as appropriate */
 
static void CheckMinActiveClients()
 
{
 
	if (!_network_dedicated || _settings_client.network.min_active_clients == 0) return;
 
	if (!_network_dedicated || _settings_client.network.min_active_clients == 0 || (_pause_mode & PM_PAUSED_ERROR) != 0) return;
 

	
 
	if (NetworkCountActiveClients() < _settings_client.network.min_active_clients) {
 
		if ((_pause_mode & PM_PAUSED_NORMAL) != 0) return;
 

	
 
		DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
 
		NetworkServerSendChat(NETWORK_ACTION_SERVER_MESSAGE, DESTTYPE_BROADCAST, 0, "", CLIENT_ID_SERVER, NETWORK_SERVER_MESSAGE_GAME_PAUSED_PLAYERS);
src/saveload/afterload.cpp
Show inline comments
 
@@ -405,12 +405,18 @@ bool AfterLoadGame()
 
	GamelogTestMode();
 

	
 
	if (CheckSavegameVersion(98)) GamelogGRFAddList(_grfconfig);
 

	
 
	if (CheckSavegameVersion(119)) {
 
		_pause_mode = (_pause_mode == 2) ? PM_PAUSED_NORMAL : PM_UNPAUSED;
 
	} else if (_network_dedicated && (_pause_mode & PM_PAUSED_ERROR) != 0) {
 
		DEBUG(net, 0, "The loading savegame was paused due to an error state.");
 
		DEBUG(net, 0, "  The savegame cannot be used for multiplayer!");
 
		/* Restore the signals */
 
		ResetSignalHandlers();
 
		return false;
 
	}
 

	
 
	/* in very old versions, size of train stations was stored differently */
 
	if (CheckSavegameVersion(2)) {
 
		Station *st;
 
		FOR_ALL_STATIONS(st) {
0 comments (0 inline, 0 general)