X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fnetwork.c;h=55e43e12207ad6e54094ba7b6dc685924ca4aa53;hb=ced5b6e12d3dcc3e55bbe1ac858e7e5308cac69c;hp=0e5955c62e103ebac1681c9f4ff9822437a77344;hpb=fdbb975aee39b32064a9fdc461467e733c7854c9;p=rocksndiamonds.git diff --git a/src/network.c b/src/network.c index 0e5955c6..55e43e12 100644 --- a/src/network.c +++ b/src/network.c @@ -541,7 +541,8 @@ static void Handle_OP_STOP_PLAYING() { int client_nr = buffer[0]; int index_nr = client_nr - 1; - boolean stopped_by_remote_player = (index_nr != local_player->index_nr); + struct PlayerInfo *client_player = &stored_player[index_nr]; + boolean stopped_by_remote_player = (!client_player->connected_locally); char *message = (buffer[2] == NETWORK_STOP_BY_PLAYER ? "Network game stopped by player!" : buffer[2] == NETWORK_STOP_BY_ERROR ? @@ -703,9 +704,13 @@ static void HandleNetworkingDisconnect() SDLNet_TCP_DelSocket(rfds, sfd); SDLNet_TCP_Close(sfd); - network.enabled = FALSE; network_playing = FALSE; + network.enabled = FALSE; + network.connected = FALSE; + + setup.network_mode = FALSE; + for (i = 0; i < MAX_PLAYERS; i++) stored_player[i].connected_network = FALSE; }