Fix mapheaderinfo[i] always returning green hills mapheader for invalid map id

This commit is contained in:
Indev 2025-12-15 20:02:00 +03:00 committed by NepDisk
parent 3d942226a5
commit 14e04ff360
2 changed files with 2 additions and 2 deletions

View file

@ -860,7 +860,7 @@ void readlevelheader(MYFILE *f, char * name)
if (exnum >= NEXTMAP_SPECIAL)
I_Error("Ran out of compatibility map slots");
}
kartmap2native[exnum-1] = num;
kartmap2native[exnum-1] = num+1;
nativemap2kart[num] = exnum-1;
if (mapheaderinfo[num]->lumpname == NULL)

View file

@ -1090,7 +1090,7 @@ INT32 G_LevelTitleToMapNum(const char * leveltitle)
INT16 G_KartMapToNative(INT16 mapnum)
{
if (mapnum > 0 && mapnum < NEXTMAP_SPECIAL)
return kartmap2native[mapnum-1]+1;
return kartmap2native[mapnum-1];
return 0;
}