- Duke: Added a file check for the map to be entered when ending a level.

World Tour contains a map definition for E5L9 but no map for it.
This commit is contained in:
Christoph Oelckers 2020-09-10 21:39:52 +02:00
parent 59eb923c11
commit 9ce8202eb1
2 changed files with 10 additions and 0 deletions

View file

@ -399,11 +399,13 @@ static int get_floorspr_clipyou(vec2_t const v1, vec2_t const v2, vec2_t const v
static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int walldist)
{
#if 0
if (enginecompatibility_mode != ENGINECOMPATIBILITY_NONE)
{
updatesector(pos.x, pos.y, sectnum);
return;
}
#endif
if (inside_p(pos.x, pos.y, *sectnum))
return;

View file

@ -1046,8 +1046,16 @@ bool setnextmap(bool checksecretexit)
map = FindNextMap(currentLevel);
}
// Make sure these two are cleared in case the map check errors out.
ud.from_bonus = 0;
ud.secretlevel = 0;
if (map)
{
// If the map doesn't exist, abort with a meaningful message instead of crashing.
if (fileSystem.FindFile(map->fileName) < 0)
{
I_Error("Trying to open non-existent %s", map->fileName.GetChars());
}
ud.from_bonus = from_bonus;
}
CompleteLevel(map);