fix crash on Chex intermission (#1368)

This commit is contained in:
Roman Fomin 2024-01-04 18:39:17 +07:00 committed by GitHub
parent e3dd725b4b
commit a519206829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ; i<NUMMAPS ; i++)
if (lnames[i])
@ -1068,11 +1068,11 @@ static void WI_drawShowNextLoc(void)
// 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)
@ -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)
{