mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- 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:
parent
63bc36e3c4
commit
0f7d3d0cbb
2 changed files with 9 additions and 8 deletions
|
@ -454,19 +454,18 @@ void UserConfig::ProcessOptions()
|
||||||
void CheckUserMap()
|
void CheckUserMap()
|
||||||
{
|
{
|
||||||
if (userConfig.CommandMap.IsEmpty()) return;
|
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;
|
FString startupMap = userConfig.CommandMap;
|
||||||
if (startupMap.IndexOfAny("/\\") < 0) startupMap.Insert(0, "/");
|
|
||||||
DefaultExtension(startupMap, ".map");
|
DefaultExtension(startupMap, ".map");
|
||||||
startupMap.Substitute("\\", "/");
|
startupMap.Substitute("\\", "/");
|
||||||
NormalizeFileName(startupMap);
|
NormalizeFileName(startupMap);
|
||||||
|
|
||||||
if (fileSystem.FileExists(startupMap))
|
if (!fileSystem.FileExists(startupMap))
|
||||||
{
|
{
|
||||||
Printf("Using level: \"%s\".\n", startupMap.GetChars());
|
Printf(PRINT_HIGH, "Level \"%s\" not found.\n", startupMap.GetChars());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Printf("Level \"%s\" not found.\n", startupMap.GetChars());
|
|
||||||
startupMap = "";
|
startupMap = "";
|
||||||
}
|
}
|
||||||
userConfig.CommandMap = startupMap;
|
userConfig.CommandMap = startupMap;
|
||||||
|
|
|
@ -453,11 +453,13 @@ void GameInterface::app_init()
|
||||||
UpdateDacs(0, true);
|
UpdateDacs(0, true);
|
||||||
|
|
||||||
enginecompatibility_mode = ENGINECOMPATIBILITY_19960925;
|
enginecompatibility_mode = ENGINECOMPATIBILITY_19960925;
|
||||||
|
|
||||||
|
gViewIndex = myconnectindex;
|
||||||
|
gMe = gView = &gPlayer[myconnectindex];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gameInit()
|
static void gameInit()
|
||||||
{
|
{
|
||||||
//RESTART:
|
|
||||||
gViewIndex = myconnectindex;
|
gViewIndex = myconnectindex;
|
||||||
gMe = gView = &gPlayer[myconnectindex];
|
gMe = gView = &gPlayer[myconnectindex];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue