vres_GetMap: Count resources in folders up until next 0-length lump
justs in case the order of stuff may be weird fixes keepmapmusic crash on some maps
This commit is contained in:
1 parent
79a5d174a5
commit
da64d3ccbf
1 file changed
+5
-1
+5
-1
@@ -2158,8 +2158,12 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
||||
// Count number of lumps until the end of resource OR up until next "MAPXX" lump.
|
||||
lumpnum_t lumppos = lumpnum + 1;
|
||||
for (i = LUMPNUM(lumppos); i < wadfiles[WADFILENUM(lumpnum)]->numlumps; i++, lumppos++, numlumps++)
|
||||
if (memcmp(W_CheckNameForNum(lumppos), "MAP", 3) == 0)
|
||||
{
|
||||
if (memcmp(W_CheckNameForNum(lumppos), "MAP", 3) == 0 || W_LumpLength(lumppos) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
numlumps++;
|
||||
|
||||
vlumps = Z_Malloc(sizeof(virtlump_t)*numlumps, PU_LEVEL, NULL);
|
||||
|
||||
Reference in new issue
Block a user