shithub: choc

Download patch

ref: 7dcb9c7e6041c12db593323751a36311ba3a54c7
parent: 8c7078eca9a086f50002d5b84a0b8e80a9d36070
author: Simon Howard <[email protected]>
date: Thu Jul 31 16:21:58 EDT 2008

Fix crash on Chex Quest intermission screen (thanks entryway)

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

--- a/src/wi_stuff.c
+++ b/src/wi_stuff.c
@@ -347,10 +347,10 @@
 //
 
 // You Are Here graphic
-static patch_t*		yah[2]; 
+static patch_t*		yah[3] = { NULL, NULL, NULL }; 
 
 // splat
-static patch_t*		splat;
+static patch_t*		splat[2] = { NULL, NULL };
 
 // %, : graphics
 static patch_t*		percent;
@@ -489,7 +489,7 @@
 	{
 	    i++;
 	}
-    } while (!fits && i!=2);
+    } while (!fits && i!=2 && c[i] != NULL);
 
     if (fits && i<2)
     {
@@ -800,11 +800,11 @@
 
 	// draw a splat on taken cities.
 	for (i=0 ; i<=last ; i++)
-	    WI_drawOnLnode(i, &splat);
+	    WI_drawOnLnode(i, splat);
 
 	// splat the secret level?
 	if (wbs->didsecret)
-	    WI_drawOnLnode(8, &splat);
+	    WI_drawOnLnode(8, splat);
 
 	// draw flashing ptr
 	if (snl_pointeron)
@@ -1590,7 +1590,7 @@
         callback(DEH_String("WIURH1"), &yah[1]);
 
 	// splat
-        callback(DEH_String("WISPLAT"), &splat);
+        callback(DEH_String("WISPLAT"), &splat[0]);
 	
 	if (wbs->epsd < 3)
 	{