Move CVar registration to before config load on server

Fixes error on startup with the rollback system.
This commit is contained in:
PJB3005
2025-10-26 23:14:11 +01:00
parent 3a337e4842
commit c9009342b6

View File

@@ -166,8 +166,12 @@ namespace Robust.Server
public bool Start(ServerOptions options, Func<ILogHandler>? logHandlerFactory = null)
{
Options = options;
_config.Initialize(true);
_config.LoadCVarsFromAssembly(typeof(BaseServer).Assembly); // Robust.Server
_config.LoadCVarsFromAssembly(typeof(IConfigurationManager).Assembly); // Robust.Shared
if (Options.LoadConfigAndUserData)
{
string? path = _commandLineArgs?.ConfigFile;
@@ -192,9 +196,6 @@ namespace Robust.Server
}
}
_config.LoadCVarsFromAssembly(typeof(BaseServer).Assembly); // Robust.Server
_config.LoadCVarsFromAssembly(typeof(IConfigurationManager).Assembly); // Robust.Shared
CVarDefaultOverrides.OverrideServer(_config);
_config.OverrideConVars(EnvironmentVariables.GetEnvironmentCVars());