From 232cc1a20b5c0be151adcb61838b1425e6ecd037 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Mon, 8 Jun 2020 22:00:24 +0200 Subject: [PATCH 1/2] Fix replay hut crashing when skins were missing --- src/m_menu.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 16cef2eb9..e9da2ad06 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5487,7 +5487,11 @@ static void DrawReplayHutReplayInfo(void) } // Character face! - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR) + + // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) + // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. + + if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR && demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF) { patch = facewantprefix[demolist[dir_on[menudepthleft]].standings[0].skin]; colormap = R_GetTranslationColormap( @@ -5685,7 +5689,11 @@ static void M_DrawReplayStartMenu(void) V_DrawString(BASEVIDWIDTH-92, STARTY + i*20 + 9, V_SNAPTOTOP, va("%d", demolist[dir_on[menudepthleft]].standings[i].timeorscore)); // Character face! - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR) + + // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) + // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. + + if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR && demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF) { patch = facerankprefix[demolist[dir_on[menudepthleft]].standings[i].skin]; colormap = R_GetTranslationColormap( @@ -7632,7 +7640,7 @@ static void M_StartGrandPrix(INT32 choice) grandprixinfo.gamespeed = KARTSPEED_HARD; grandprixinfo.masterbots = true; break; - + } grandprixinfo.encore = (boolean)(cv_dummygpencore.value); From 3914128ce3744d902b6f3d08749664c8f794f1a1 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Mon, 8 Jun 2020 22:11:42 +0200 Subject: [PATCH 2/2] Check for missing skin before the lump --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index e9da2ad06..9fdd70b12 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5491,7 +5491,7 @@ static void DrawReplayHutReplayInfo(void) // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR && demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF) + if (demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF && W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR) { patch = facewantprefix[demolist[dir_on[menudepthleft]].standings[0].skin]; colormap = R_GetTranslationColormap( @@ -5693,7 +5693,7 @@ static void M_DrawReplayStartMenu(void) // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR && demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF) + if (demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF && W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR) { patch = facerankprefix[demolist[dir_on[menudepthleft]].standings[i].skin]; colormap = R_GetTranslationColormap(