mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-03 06:33:14 +00:00
Only allow W_CheckNumForMap to return lumpnums fitting certain criteria
- For PK3, if it's a .wad - For .wad, if it's a header (0-length)
This commit is contained in:
parent
959bb14f59
commit
8afd9b03b2
1 changed files with 18 additions and 4 deletions
22
src/w_wad.c
22
src/w_wad.c
|
|
@ -966,8 +966,15 @@ UINT16 W_CheckNumForMapPwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||||
{
|
{
|
||||||
for (i = startlump; i < wadfiles[wad]->numlumps; i++)
|
for (i = startlump; i < wadfiles[wad]->numlumps; i++)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(name, (wadfiles[wad]->lumpinfo + i)->name))
|
// Not the name?
|
||||||
return i;
|
if (strcasecmp(name, (wadfiles[wad]->lumpinfo + i)->name))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Not a header?
|
||||||
|
if (W_LumpLength(i | (wad << 16)) > 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (wadfiles[wad]->type == RET_PK3)
|
else if (wadfiles[wad]->type == RET_PK3)
|
||||||
|
|
@ -981,8 +988,15 @@ UINT16 W_CheckNumForMapPwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||||
// Now look for the specified map.
|
// Now look for the specified map.
|
||||||
for (; i < end; i++)
|
for (; i < end; i++)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(name, (wadfiles[wad]->lumpinfo + i)->longname))
|
// Not the name?
|
||||||
return i;
|
if (strcasecmp(name, (wadfiles[wad]->lumpinfo + i)->longname))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Not a .wad?
|
||||||
|
if (!W_IsLumpWad(i | (wad << 16)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue