Changeset - r717:02ff19796b81
[Not reviewed]
master
0 2 0
truelight - 19 years ago 2004-12-19 10:24:45
truelight@openttd.org
(svn r1169) -Fix: [Network] [ 1087591 ] When you want to be a spectator, you now
stay a spectator even if someone else joins.
2 files changed with 5 insertions and 8 deletions:
0 comments (0 inline, 0 general)
network_client.c
Show inline comments
 
@@ -505,18 +505,12 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER
 
			}
 
		} else {
 
			// take control over an existing company
 
			_local_player = _network_playas - 1;
 
			DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
		}
 

	
 
		// Remeber the player
 
		if (_local_player != OWNER_SPECTATOR)
 
			_network_playas = _local_player + 1;
 
		else
 
			_network_playas = OWNER_SPECTATOR;
 
	}
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FRAME)
players.c
Show inline comments
 
@@ -650,14 +650,17 @@ int32 CmdPlayerCtrl(int x, int y, uint32
 
			/* In case we are a client joining a server... */
 
			DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
#endif /* ENABLE_NETWORK */
 

	
 
		if (p != NULL) {
 
			if (_local_player == OWNER_SPECTATOR) {
 
				_local_player = p->index;
 
				MarkWholeScreenDirty();
 
				/* Check if we do not want to be a spectator in network */
 
				if (!_networking || _network_server || _network_playas != OWNER_SPECTATOR) {
 
					_local_player = p->index;
 
					MarkWholeScreenDirty();
 
				}
 
			}
 
#ifdef ENABLE_NETWORK
 
			if (_network_server) {
 
				NetworkClientInfo *ci;
 
				// UGLY! p2 is mis-used to fetch the client-id
 
				ci = &_network_client_info[p2];
0 comments (0 inline, 0 general)