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
1d2d8d58db
commit
3bd6c99a3b
1 file changed
+5
-1
+5
-1
@@ -2161,8 +2161,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