shithub: choc

Download patch

ref: 3b8e76e7363712827be27729a79b0d3139a2ff97
parent: f306694f46938ef70804d5709feccac36c302e77
author: Simon Howard <fraggle@gmail.com>
date: Thu Mar 16 16:46:59 EST 2006

Fix crasher when starting new levels, because the intermissions code
tries to draw patches which have been unloaded (WI_Drawer runs
after WI_End, because it is waiting for the game loop to load
the new level)

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 421

--- a/src/wi_stuff.c
+++ b/src/wi_stuff.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: wi_stuff.c 352 2006-01-28 20:03:09Z fraggle $
+// $Id: wi_stuff.c 421 2006-03-16 21:46:59Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -44,7 +44,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: wi_stuff.c 352 2006-01-28 20:03:09Z fraggle $";
+rcsid[] = "$Id: wi_stuff.c 421 2006-03-16 21:46:59Z fraggle $";
 
 #include <stdio.h>
 
@@ -748,6 +748,11 @@
 {
     void WI_unloadData(void);
     WI_unloadData();
+
+    // Set state to finished.  This prevents trying to draw the screen
+    // again using any of the patches we have now unloaded.
+
+    state = FinishedIntermission;
 }
 
 void WI_initNoState(void)
@@ -1554,6 +1559,9 @@
       case NoState:
 	WI_updateNoState();
 	break;
+
+      case FinishedIntermission:
+        break;
     }
 
 }
@@ -1814,6 +1822,9 @@
       case NoState:
 	WI_drawNoState();
 	break;
+
+      case FinishedIntermission:
+        break;
     }
 }
 
--- a/src/wi_stuff.h
+++ b/src/wi_stuff.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: wi_stuff.h 8 2005-07-23 16:44:57Z fraggle $
+// $Id: wi_stuff.h 421 2006-03-16 21:46:59Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -39,8 +39,8 @@
 {
     NoState = -1,
     StatCount,
-    ShowNextLoc
-
+    ShowNextLoc,
+    FinishedIntermission,
 } stateenum_t;
 
 // Called by main loop, animate the intermission.