From 83e3fc9229a14e74455b51ac635cb627d40db1ca Mon Sep 17 00:00:00 2001 From: mcmartin Date: Wed, 20 Apr 2005 02:22:52 +0000 Subject: [PATCH] Cleanup to fix to #678, after discussion in #sc2dev git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1659 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/clock.c | 19 +++++++++++++++---- sc2/src/sc2code/confirm.c | 6 ++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sc2/src/sc2code/clock.c b/sc2/src/sc2code/clock.c index c6383da32..f0585ce2b 100644 --- a/sc2/src/sc2code/clock.c +++ b/sc2/src/sc2code/clock.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "gameev.h" #include "globdata.h" #include "setup.h" @@ -222,9 +223,14 @@ UninitGameClock (void) void SuspendGameClock (void) { - if (! clock_mutex) + if (!clock_mutex) + { + fprintf (stderr, "BUG: Attempted to suspend non-existent game clock\n"); +#ifdef DEBUG + abort(); +#endif return; - + } LockMutex (clock_mutex); if (GameClockRunning ()) { @@ -237,9 +243,14 @@ SuspendGameClock (void) void ResumeGameClock (void) { - if (! clock_mutex) + if (!clock_mutex) + { + fprintf (stderr, "BUG: Attempted to resume non-existent game clock\n"); +#ifdef DEBUG + abort(); +#endif return; - + } LockMutex (clock_mutex); if (!GameClockRunning ()) { diff --git a/sc2/src/sc2code/confirm.c b/sc2/src/sc2code/confirm.c index f02f709eb..39e15e483 100644 --- a/sc2/src/sc2code/confirm.c +++ b/sc2/src/sc2code/confirm.c @@ -86,7 +86,8 @@ DoConfirmExit (void) BOOLEAN result; static BOOLEAN in_confirm = FALSE; fprintf (stderr, "Confirming Exit!\n"); - if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE) + if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE && + LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE) SuspendGameClock (); if (CommData.ConversationPhrases && PlayingTrack ()) PauseTrack (); @@ -178,7 +179,8 @@ DoConfirmExit (void) } UnlockMutex (GraphicsLock); - if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE) + if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE && + LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE) ResumeGameClock (); if (CommData.ConversationPhrases && PlayingTrack ()) {