From 6d9c657b119e274cfc01e537a8bb342cf5a868f1 Mon Sep 17 00:00:00 2001 From: NY00123 Date: Sat, 11 Apr 2020 12:39:27 +0300 Subject: [PATCH] SW: This is a better place for a slave which quits to set QuitFlag --- source/sw/src/network.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index 6ef0a1caa..8330daa19 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -74,6 +74,7 @@ extern SWBOOL PauseKeySet; gNET gNet; extern short PlayerQuitMenuLevel; +extern SWBOOL QuitFlag; #define TIMERUPDATESIZ 32 @@ -688,7 +689,6 @@ SWBOOL MyCommPlayerQuit(void) PLAYERp pp; short i; short prev_player = 0; - extern SWBOOL QuitFlag; short found = FALSE; short quit_player_index = 0; @@ -980,6 +980,10 @@ faketimerhandler(void) memset(&AveragePacket, 0, sizeof(AveragePacket)); + // Slave won't receive the quit bit back from the master, so handle it separately + if (TEST(loc.bits, 1 << SK_QUIT_GAME) && !NetBroadcastMode && (myconnectindex != connecthead)) + QuitFlag = TRUE; + pp->inputfifo[Player[myconnectindex].movefifoend & (MOVEFIFOSIZ - 1)] = loc; pp->movefifoend++; Bmemset(&loc, 0, sizeof(loc));