mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1169) -Fix: [Network] [ 1087591 ] When you want to be a spectator, you now
stay a spectator even if someone else joins.
This commit is contained in:
parent
0e19f74c16
commit
4d94803d32
|
@ -508,12 +508,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP)
|
||||||
_local_player = _network_playas - 1;
|
_local_player = _network_playas - 1;
|
||||||
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
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;
|
return NETWORK_RECV_STATUS_OKAY;
|
||||||
|
|
|
@ -653,9 +653,12 @@ int32 CmdPlayerCtrl(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
if (_local_player == OWNER_SPECTATOR) {
|
if (_local_player == OWNER_SPECTATOR) {
|
||||||
|
/* Check if we do not want to be a spectator in network */
|
||||||
|
if (!_networking || _network_server || _network_playas != OWNER_SPECTATOR) {
|
||||||
_local_player = p->index;
|
_local_player = p->index;
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
if (_network_server) {
|
if (_network_server) {
|
||||||
NetworkClientInfo *ci;
|
NetworkClientInfo *ci;
|
||||||
|
|
Loading…
Reference in New Issue