From a519206829e17c0ba70f4862d154fbac55ffcdb7 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Thu, 4 Jan 2024 18:39:17 +0700 Subject: [PATCH] fix crash on Chex intermission (#1368) --- src/wi_stuff.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wi_stuff.c b/src/wi_stuff.c index 60683a90..c975a799 100644 --- a/src/wi_stuff.c +++ b/src/wi_stuff.c @@ -318,10 +318,10 @@ static int NUMCMAPS; // // 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; @@ -565,7 +565,7 @@ WI_drawOnLnode // draw stuff at a location by episode/map# else i++; } - while (!fits && i!=2); + while (!fits && i!=2 && c[i]); if (fits && i<2) { @@ -883,7 +883,7 @@ static void WI_unloadData(void) Z_ChangeTag(yah[0], PU_CACHE); Z_ChangeTag(yah[1], PU_CACHE); - Z_ChangeTag(splat, PU_CACHE); + Z_ChangeTag(splat[0], PU_CACHE); for (i=0 ; ididsecret) - WI_drawOnLnode(8, &splat); + WI_drawOnLnode(8, splat); // draw flashing ptr if (snl_pointeron) @@ -1999,7 +1999,7 @@ void WI_loadData(void) yah[1] = W_CacheLumpName("WIURH1", PU_STATIC); // splat - splat = W_CacheLumpName("WISPLAT", PU_STATIC); + splat[0] = W_CacheLumpName("WISPLAT", PU_STATIC); if (wbs->epsd < 3) {