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
This commit is contained in:
+15
-4
@@ -16,6 +16,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#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 ())
|
||||
{
|
||||
|
||||
@@ -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 ())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user