- streamlined and fixed game startup with '-map' option.

* Blood: Initialize global pointers in app_init so that they are not NULL.
* consider Mapinfo data when checking for a given level name.
* removed redundant level name output.
This commit is contained in:
Christoph Oelckers 2021-06-26 10:11:50 +02:00
parent 63bc36e3c4
commit 0f7d3d0cbb
2 changed files with 9 additions and 8 deletions

View File

@ -454,19 +454,18 @@ void UserConfig::ProcessOptions()
void CheckUserMap()
{
if (userConfig.CommandMap.IsEmpty()) return;
if (FindMapByName(userConfig.CommandMap))
{
return; // we already got a record for this map so no need for further checks.
}
FString startupMap = userConfig.CommandMap;
if (startupMap.IndexOfAny("/\\") < 0) startupMap.Insert(0, "/");
DefaultExtension(startupMap, ".map");
startupMap.Substitute("\\", "/");
NormalizeFileName(startupMap);
if (fileSystem.FileExists(startupMap))
if (!fileSystem.FileExists(startupMap))
{
Printf("Using level: \"%s\".\n", startupMap.GetChars());
}
else
{
Printf("Level \"%s\" not found.\n", startupMap.GetChars());
Printf(PRINT_HIGH, "Level \"%s\" not found.\n", startupMap.GetChars());
startupMap = "";
}
userConfig.CommandMap = startupMap;

View File

@ -453,11 +453,13 @@ void GameInterface::app_init()
UpdateDacs(0, true);
enginecompatibility_mode = ENGINECOMPATIBILITY_19960925;
gViewIndex = myconnectindex;
gMe = gView = &gPlayer[myconnectindex];
}
static void gameInit()
{
//RESTART:
gViewIndex = myconnectindex;
gMe = gView = &gPlayer[myconnectindex];