From d1c7a90a7c2773982a232bb854007dd827714089 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 5 Feb 2023 19:25:23 +0000 Subject: [PATCH] G_UpdateTimeStickerMedals: Put an actual message on the sticker where an invalid medal ghost tag is handled Fixes a function reshuffling error that would have put control flow back in a loop with invalid properties --- src/g_game.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 960166b70..2687a5048 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -552,9 +552,11 @@ bademblem: { if (emblem->tag > mapheaderinfo[map]->ghostCount || mapheaderinfo[map]->ghostBrief[emblem->tag-1] == NULL) - goto bademblem; - - stickermedalinfo.timetoreach = mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time; + snprintf(stickermedalinfo.targettext, 9, "Invalid ghost tag"); + else if (mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time == UINT32_MAX) + snprintf(stickermedalinfo.targettext, 9, "Ghost DNF"); + else + stickermedalinfo.timetoreach = mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time; } } }