summaryrefslogtreecommitdiff
path: root/network_client.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-23 13:53:05 +0000
committertruelight <truelight@openttd.org>2004-12-23 13:53:05 +0000
commita14a78de3426b38d8f5d95304f26eab70986a3f9 (patch)
tree2af4202f587c7b007b6e2a3ef1697b3c620bcc00 /network_client.c
parent533e7a97ef30c6bb3c477b9bdc93eca306761a89 (diff)
downloadopenttd-a14a78de3426b38d8f5d95304f26eab70986a3f9.tar.xz
(svn r1246) -Fix: [ 1090099 ] Company-messages did crash the game, because
company-index was sent, which should have been the client-index
Diffstat (limited to 'network_client.c')
-rw-r--r--network_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/network_client.c b/network_client.c
index b929af1ba..e99a45794 100644
--- a/network_client.c
+++ b/network_client.c
@@ -619,6 +619,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CHAT)
case NETWORK_ACTION_CHAT_PLAYER:
case NETWORK_ACTION_GIVE_MONEY:
/* For speak to player or give money, we need the player-name */
+ if (ci_to->client_playas > MAX_PLAYERS)
+ return NETWORK_RECV_STATUS_OKAY; // This should never happen
GetString(name, DEREF_PLAYER(ci_to->client_playas-1)->name_1);
ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
break;