- Blood: allow bad start spots to pass for modern maps.

These can have alternative start spot definitions.
The error will still be printed, though.
This commit is contained in:
Christoph Oelckers 2022-01-13 00:21:15 +01:00
parent 1b162ececc
commit a13612ab9b
3 changed files with 5 additions and 5 deletions

View file

@ -418,7 +418,7 @@ void fixSectors()
}
}
void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnum, unsigned numsectors)
void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnum, unsigned numsectors, bool noabort)
{
if ((unsigned)(*cursectnum) >= numsectors)
@ -426,10 +426,10 @@ void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnu
sectortype* sect = nullptr;
updatesectorz(pos.X, pos.Y, pos.Z, &sect);
if (!sect) updatesector(pos.X, pos.Y, &sect);
if (sect)
if (sect || noabort)
{
Printf(PRINT_HIGH, "Error in map %s: Start sector %d out of range. Max. sector is %d\n", filename, *cursectnum, numsectors);
*cursectnum = sectnum(sect);
*cursectnum = sect? sectnum(sect) : 0;
}
else
{

View file

@ -648,4 +648,4 @@ void loadMap(const char *filename, int flags, vec3_t *pos, int16_t *ang, int *cu
TArray<walltype> loadMapWalls(const char* filename);
void loadMapBackup(const char* filename);
void loadMapHack(const char* filename, const unsigned char*, SpawnSpriteDef& sprites);
void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnum, unsigned numsectors);
void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnum, unsigned numsectors, bool noabort = false);

View file

@ -672,7 +672,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
sectionGeometry.SetSize(sections.Size());
wallbackup = wall;
sectorbackup = sector;
validateStartSector(mapname.GetChars(), { *pX, *pY, *pZ }, cursectnum, mapHeader.numsectors);
validateStartSector(mapname.GetChars(), { *pX, *pY, *pZ }, cursectnum, mapHeader.numsectors, gModernMap);
}