Fix compat skins crashing if the sprites are at the end of the WAD

This commit is contained in:
GenericHeroGuy 2025-08-20 17:34:30 +02:00
parent bd9924b794
commit 75296f00fd

View file

@ -503,6 +503,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski
*lump += 1; // start after S_SKIN
*lastlump = W_CheckNumForNamePwad("S_END",wadnum,*lump); // stop at S_END
*lastlump = min(*lastlump, wadfiles[wadnum]->numlumps); // or end of WAD
// old wadding practices die hard -- stop at S_SKIN (or P_SKIN) or S_START if they come before S_END.
newlastlump = W_FindNextEmptyInPwad(wadnum,*lump);