From a5bb96ce9b6dbe13245a9ee0986646c8733e01c5 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Thu, 13 Mar 2025 13:55:28 -0400 Subject: [PATCH] Cup changes to allow the same map in multiple --- src/p_setup.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index e801b8d3e..207379574 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -9032,20 +9032,21 @@ UINT8 P_InitMapData(boolean existingmapheaders) { for (j = 0; j < CUPCACHE_MAX; j++) { + // No level in this slot? + if (!cup->levellist[j]) + continue; + // Already discovered? if (cup->cachedlevels[j] != NEXTMAP_INVALID) continue; - if (!cup->levellist[j] || strcasecmp(cup->levellist[j], name) != 0) + // Not your name? + if (strcasecmp(cup->levellist[j], name) != 0) continue; - // Only panic about back-reference for non-bonus material. - if (j < MAXLEVELLIST) - { - if (mapheaderinfo[i]->cup) - I_Error("P_InitMapData: Map %s cannot appear in cups multiple times! (First in %s, now in %s)", name, mapheaderinfo[i]->cup->name, cup->name); + // Have a map recognise the first cup it's a part of. + if (!mapheaderinfo[i]->cup) mapheaderinfo[i]->cup = cup; - } cup->cachedlevels[j] = i; }