From 91f411d52bff5adc2cc3d6f6ae6358ba43d12f8b Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 20 Oct 2023 20:39:16 +0100 Subject: [PATCH] VC requests for auto-naming AltMusic Challenge - Replace the track #1/#2 with side B/C - Add invalid map-set text --- src/m_cond.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 6055586c4..39383aafc 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1036,6 +1036,8 @@ static void M_PrecacheLevelLocks(void) case SECRET_ALTMUSIC: { UINT16 map = M_UnlockableMapNum(&unlockables[i]); + const char *tempstr = NULL; + if (map < nummapheaders && mapheaderinfo[map]) { @@ -1048,7 +1050,6 @@ static void M_PrecacheLevelLocks(void) mapheaderinfo[map]->cache_muslock[j - 1] = i; - const char *tempstr = NULL; UINT8 positionid = 0; if (mapheaderinfo[map]->cup) @@ -1070,11 +1071,11 @@ static void M_PrecacheLevelLocks(void) } tempstr = va( - "Music: %s Cup %c%u #%u", + "Music: %s Cup %c%u %c", mapheaderinfo[map]->cup->realname, prefix, positionid + 1, - j + 'A' + j // :D ? ); } } @@ -1097,23 +1098,24 @@ static void M_PrecacheLevelLocks(void) } tempstr = va( - "Music: %s #%u #%u", + "Music: %s #%u %c", (mapheaderinfo[map]->typeoflevel & TOL_TUTORIAL) ? "Tutorial" : "Lost and Found", positionid + 1, - j + 'A' + j // :D ? ); } - if (tempstr != NULL) - { - strlcpy(unlockables[i].name, tempstr, sizeof (unlockables[i].name)); - } - break; } if (j == mapheaderinfo[map]->musname_size) CONS_Alert(CONS_ERROR, "Unlockable %u: Too many SECRET_ALTMUSICs associated with Level %s\n", i, mapheaderinfo[map]->lumpname); } + + if (tempstr == NULL) + tempstr = va("INVALID MUSIC UNLOCK %u", i); + + strlcpy(unlockables[i].name, tempstr, sizeof (unlockables[i].name)); + break; }