mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- check if a map file exists before starting it.
This commit is contained in:
parent
97f395bd72
commit
3eef0db6f6
2 changed files with 15 additions and 3 deletions
|
@ -242,6 +242,7 @@ void StartLevel(MapRecord* level)
|
||||||
paused = 0;
|
paused = 0;
|
||||||
levelTryPlayMusic();
|
levelTryPlayMusic();
|
||||||
gChoke.reset();
|
gChoke.reset();
|
||||||
|
Printf(TEXTCOLOR_GOLD "%s: %s\n", level->LabelName(), level->DisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,10 @@ static MapRecord* levelwarp_common(FCommandLine& argv, const char *cmdname, cons
|
||||||
else Printf(PRINT_BOLD, "Level %s not found!\n", argv[1]);
|
else Printf(PRINT_BOLD, "Level %s not found!\n", argv[1]);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
if (fileSystem.FindFile(map->fileName) < 0)
|
||||||
|
{
|
||||||
|
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
|
||||||
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,9 +367,6 @@ CCMD(changemap)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FString mapname = argv[1];
|
FString mapname = argv[1];
|
||||||
FString mapfilename = mapname;
|
|
||||||
DefaultExtension(mapfilename, ".map");
|
|
||||||
|
|
||||||
auto map = FindMapByName(mapname);
|
auto map = FindMapByName(mapname);
|
||||||
if (map == nullptr)
|
if (map == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -379,6 +380,11 @@ CCMD(changemap)
|
||||||
Printf(PRINT_BOLD, "%s: Cannot warp to user maps.\n", mapname.GetChars());
|
Printf(PRINT_BOLD, "%s: Cannot warp to user maps.\n", mapname.GetChars());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (fileSystem.FindFile(map->fileName) < 0)
|
||||||
|
{
|
||||||
|
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
|
||||||
|
}
|
||||||
|
|
||||||
ChangeLevel(map, -1);
|
ChangeLevel(map, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +426,11 @@ CCMD(map)
|
||||||
}
|
}
|
||||||
if (map)
|
if (map)
|
||||||
{
|
{
|
||||||
|
if (fileSystem.FindFile(map->fileName) < 0)
|
||||||
|
{
|
||||||
|
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
|
||||||
|
}
|
||||||
|
|
||||||
DeferedStartGame(map, -1);
|
DeferedStartGame(map, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue