From de6919c64f43818d642669cbb57b26a1ba959c78 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Fri, 7 Feb 2025 10:38:54 -0500 Subject: [PATCH] vres_GetMap: Count resources in folders up until next 0-length lump, instead of 'MAP' https://git.do.srb2.org/KartKrew/RingRacers/-/commit/89a22783b6ae069583e15e11891c987a38ae89b3 --- src/w_wad.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 84487db5b..841fbc498 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2512,7 +2512,7 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) } else { - // Count number of lumps until the end of resource OR up until next "MAPXX" lump. + // Count number of lumps until the end of resource OR up until next 0-length lump. lumpnum_t lumppos = lumpnum + 1; lumpnum_t lastlump = wadfiles[WADFILENUM(lumpnum)]->numlumps; // or the end of directory, for PK3 files @@ -2526,8 +2526,12 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) free(dirname); } for (i = LUMPNUM(lumppos); i < lastlump; i++, lumppos++, numlumps++) - if (memcmp(W_CheckNameForNum(lumppos), "MAP", 3) == 0) + { + if (W_LumpLength(lumppos) == 0) + { break; + } + } numlumps++; vlumps = Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL); @@ -2621,4 +2625,4 @@ void *vres_GetPatch(virtlump_t *vlump, INT32 tag) Patch_CreateGL(patch); return (void *)patch; #endif -} \ No newline at end of file +}