projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a07df3
)
added stopping game (with request dialog) if network player disconnected
author
Holger Schemel
<info@artsoft.org>
Sun, 1 Jul 2018 11:04:25 +0000
(13:04 +0200)
committer
Holger Schemel
<info@artsoft.org>
Sun, 1 Jul 2018 11:04:25 +0000
(13:04 +0200)
src/network.c
patch
|
blob
|
history
diff --git
a/src/network.c
b/src/network.c
index b7c753b45f9e429b56b07116e1b5323d9cfaa011..c4e2ee6e09016cd6b9aab2c7af937986a8241c9b 100644
(file)
--- 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()