Merge branch 'warpwithoutmapheaderfix' into 'next'

Fix "-warp"ing to a level without a map header crashing the game

Closes #1105

See merge request STJr/SRB2!2143
This commit is contained in:
sphere 2023-09-12 20:13:46 +00:00
commit 0f5e80a122

View file

@ -509,7 +509,7 @@ UINT8 M_CampaignWarpIsCheat(INT32 gt, INT32 mapnum, gamedata_t *data)
return true;
}
if (mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU)
if (!mapheaderinfo[mapnum-1] || mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU)
{
// You're never allowed to warp to this level.
return true;