summaryrefslogtreecommitdiff
path: root/src/g_game.c
diff options
context:
space:
mode:
authorSimon Howard2006-06-21 19:08:20 +0000
committerSimon Howard2006-06-21 19:08:20 +0000
commitfa32d12bfa647565cce1b2f9e25ad7d7b0a1d4fc (patch)
tree81aac709eae369e2ebfdb1a07cc006b956adfdd5 /src/g_game.c
parentdecc0a876f8fa1c3cd8fef6307809c6617933b73 (diff)
downloadchocolate-doom-fa32d12bfa647565cce1b2f9e25ad7d7b0a1d4fc.tar.gz
chocolate-doom-fa32d12bfa647565cce1b2f9e25ad7d7b0a1d4fc.tar.bz2
chocolate-doom-fa32d12bfa647565cce1b2f9e25ad7d7b0a1d4fc.zip
Let the SDL parachute catch crashes and shut down properly. Don't crash
after playing demos. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 562
Diffstat (limited to 'src/g_game.c')
-rw-r--r--src/g_game.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/g_game.c b/src/g_game.c
index 6fe36116..e603ee63 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: g_game.c 475 2006-05-05 19:49:34Z fraggle $
+// $Id: g_game.c 562 2006-06-21 19:08:20Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -134,7 +134,7 @@
static const char
-rcsid[] = "$Id: g_game.c 475 2006-05-05 19:49:34Z fraggle $";
+rcsid[] = "$Id: g_game.c 562 2006-06-21 19:08:20Z fraggle $";
#include <string.h>
#include <stdlib.h>
@@ -1889,15 +1889,16 @@ boolean G_CheckDemoStatus (void)
realtics = endtime - starttime;
fps = ((float) gametic * 35) / realtics;
+ // Prevent recursive calls
+ timingdemo = false;
+ demoplayback = false;
+
I_Error ("timed %i gametics in %i realtics (%f fps)",
gametic, realtics, fps);
}
if (demoplayback)
{
- if (singledemo)
- I_Quit ();
-
Z_ChangeTag (demobuffer, PU_CACHE);
demoplayback = false;
netdemo = false;
@@ -1908,7 +1909,12 @@ boolean G_CheckDemoStatus (void)
fastparm = false;
nomonsters = false;
consoleplayer = 0;
- D_AdvanceDemo ();
+
+ if (singledemo)
+ I_Quit ();
+ else
+ D_AdvanceDemo ();
+
return true;
}