From a32b33ef1bcc91553340a25991763f950938b6c3 Mon Sep 17 00:00:00 2001 From: Phil Marell Date: Sat, 24 Jul 2021 16:24:56 +1000 Subject: [PATCH] =?UTF-8?q?Ask=20to=20save=20game=20if=20user=20=E2=80=9Ce?= =?UTF-8?q?xternally=E2=80=9D=20quits=20while=20in-game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An “external quit” being defined as one where the portability handler receives a request to quit the app, such as closing the window, or on macOS using the Quit menu item. This can prevent the user losing their progress after having finished with a game. --- GpApp/Play.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GpApp/Play.cpp b/GpApp/Play.cpp index 1715dc0..9e2923f 100644 --- a/GpApp/Play.cpp +++ b/GpApp/Play.cpp @@ -46,7 +46,7 @@ void HandleRoomVisitation (void); void SetObjectsToDefaults (void); void InitTelephone (void); void HandleTelephone (void); - +void DoEndGame (void); phoneType thePhone, theChimes; Rect glidSrcRect, justRoomsRect; @@ -717,7 +717,11 @@ void PlayGame (void) HandleDynamicScoreboard(); } } - + + if (quitting) { + DoEndGame(); + } + if (gameOver) { countDown--;