diff options
-rw-r--r-- | network_client.c | 2 | ||||
-rw-r--r-- | network_server.c | 2 |
2 files changed, 3 insertions, 1 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; diff --git a/network_server.c b/network_server.c index a42d7b5c8..91ff13e1c 100644 --- a/network_server.c +++ b/network_server.c @@ -995,7 +995,7 @@ void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest, } else { FOR_ALL_CLIENTS(cs) { if (cs->index == from_index) { - SEND_COMMAND(PACKET_SERVER_CHAT)(cs, action, dest, true, msg); + SEND_COMMAND(PACKET_SERVER_CHAT)(cs, action, ci_to->client_index, true, msg); } } } |