Changeset - r9651:0fa75691a92a
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-07-17 16:38:26
rubidium@openttd.org
(svn r13718) -Fix: possible desync on the autorenew settings 20+ game years (i.e. 4.5+ hours) after a company was started.
1 file changed with 12 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/players.cpp
Show inline comments
 
@@ -866,18 +866,21 @@ CommandCost CmdPlayerCtrl(TileIndex tile
 
				char *password = _settings_client.network.default_company_pass;
 
				NetworkChangeCompanyPassword(1, &password);
 
			}
 

	
 
			_current_player = _local_player;
 

	
 
			/* Now that we have a new player, broadcast our autorenew settings to
 
			 * all clients so everything is in sync */
 
			NetworkSend_Command(0,
 
				(_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
 
				_settings_client.gui.autorenew_money,
 
				CMD_SET_AUTOREPLACE,
 
				NULL
 
			);
 

	
 
			MarkWholeScreenDirty();
 
		}
 

	
 
		/* Now that we have a new player, broadcast its autorenew settings to
 
		 * all clients so everything is in sync */
 
		DoCommand(0,
 
			(_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
 
			_settings_client.gui.autorenew_money,
 
			DC_EXEC,
 
			CMD_SET_AUTOREPLACE
 
		);
 

	
 
		if (_network_server) {
 
			/* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at
 
			 * server-side in network_server.c:838, function
0 comments (0 inline, 0 general)