summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-19 10:24:45 +0000
committertruelight <truelight@openttd.org>2004-12-19 10:24:45 +0000
commit84475dc5038373599b10c6f5c1b9c59680524e3c (patch)
treebe56000562eab42ed87d2d6c4aec8dd666e503e1
parentdf995a32ed6e65dfe64f6e46cd3819a1e6f2e0e8 (diff)
downloadopenttd-84475dc5038373599b10c6f5c1b9c59680524e3c.tar.xz
(svn r1169) -Fix: [Network] [ 1087591 ] When you want to be a spectator, you now
stay a spectator even if someone else joins.
-rw-r--r--network_client.c6
-rw-r--r--players.c7
2 files changed, 5 insertions, 8 deletions
diff --git a/network_client.c b/network_client.c
index 1ac821fc1..524a7b018 100644
--- a/network_client.c
+++ b/network_client.c
@@ -508,12 +508,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP)
_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;
diff --git a/players.c b/players.c
index 1bccd06c2..86feeb944 100644
--- a/players.c
+++ b/players.c
@@ -653,8 +653,11 @@ int32 CmdPlayerCtrl(int x, int y, uint32 flags, uint32 p1, uint32 p2)
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) {