mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 10:02:01 +00:00
vres_GetMap: Count resources in folders up until next 0-length lump, instead of "MAPXX"
As having named map lumps means the lump being named "MAPXX" isn't guaranteed anymore.
This commit is contained in:
parent
bd965ccd50
commit
89a22783b6
1 changed files with 6 additions and 2 deletions
|
|
@ -2278,11 +2278,15 @@ 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;
|
||||
for (i = LUMPNUM(lumppos); i < wadfiles[WADFILENUM(lumpnum)]->numlumps; 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue