From: Holger Schemel Date: Sun, 1 Jul 2018 11:04:25 +0000 (+0200) Subject: added stopping game (with request dialog) if network player disconnected X-Git-Tag: 4.1.1.0~93 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e2d0636d9a2b123a1c880c1142f29ed296023cae;p=rocksndiamonds.git added stopping game (with request dialog) if network player disconnected --- diff --git a/src/network.c b/src/network.c index b7c753b4..c4e2ee6e 100644 --- a/src/network.c +++ b/src/network.c @@ -577,6 +577,20 @@ static void Handle_OP_PLAYER_DISCONNECTED() stored_player[index_nr].connected_locally = FALSE; stored_player[index_nr].connected_network = FALSE; + + if (game_status == GAME_MODE_PLAYING) + { + char message[100]; + + sprintf(message, "Player %d left network server! Network game stopped!", + player_nr); + + Request(message, REQ_CONFIRM | REQ_STAY_CLOSED); + + SetGameStatus(GAME_MODE_MAIN); + + DrawMainMenu(); + } } static void Handle_OP_START_PLAYING()