mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Make command line config file not exception if not found (#3030)
This commit is contained in:
@@ -153,26 +153,25 @@ namespace Robust.Server
|
||||
|
||||
if (Options.LoadConfigAndUserData)
|
||||
{
|
||||
string? path = _commandLineArgs?.ConfigFile;
|
||||
|
||||
// Sets up the configMgr
|
||||
// If a config file path was passed, use it literally.
|
||||
// This ensures it's working-directory relative
|
||||
// (for people passing config file through the terminal or something).
|
||||
// Otherwise use the one next to the executable.
|
||||
if (_commandLineArgs?.ConfigFile != null)
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
_config.LoadFromFile(_commandLineArgs.ConfigFile);
|
||||
path = PathHelpers.ExecutableRelativeFile("server_config.toml");
|
||||
}
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
_config.LoadFromFile(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
var path = PathHelpers.ExecutableRelativeFile("server_config.toml");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
_config.LoadFromFile(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
_config.SetSaveFile(path);
|
||||
}
|
||||
_config.SetSaveFile(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user