Fix some runstate if checks
This commit is contained in:
committed by
Maplewheels
parent
6499e7608c
commit
d70885711b
@@ -400,20 +400,30 @@ namespace Barotrauma
|
||||
return;
|
||||
if (runState > CurrentRunState)
|
||||
{
|
||||
if (CurrentRunState < RunState.Parsed)
|
||||
if (CurrentRunState <= RunState.Parsed)
|
||||
{
|
||||
LoadCurrentContentPackageInfos();
|
||||
|
||||
if (runState <= CurrentRunState)
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentRunState < RunState.Configuration)
|
||||
if (runState <= CurrentRunState)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentRunState <= RunState.Configuration)
|
||||
{
|
||||
LoadStaticAssets();
|
||||
}
|
||||
|
||||
if (runState <= CurrentRunState)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentRunState < RunState.Running)
|
||||
if (CurrentRunState <= RunState.Running)
|
||||
{
|
||||
RunScripts();
|
||||
}
|
||||
}
|
||||
else if (runState < CurrentRunState)
|
||||
{
|
||||
@@ -423,18 +433,22 @@ namespace Barotrauma
|
||||
ProcessPackagesListDifferences();
|
||||
_runState = RunState.Configuration;
|
||||
}
|
||||
|
||||
|
||||
if (runState >= CurrentRunState)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentRunState == RunState.Configuration)
|
||||
{
|
||||
UnloadStaticAssets();
|
||||
_runState = RunState.Parsed;
|
||||
}
|
||||
|
||||
|
||||
if (runState >= CurrentRunState)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentRunState == RunState.Parsed)
|
||||
{
|
||||
@@ -487,7 +501,7 @@ namespace Barotrauma
|
||||
|
||||
void LoadStaticAssets()
|
||||
{
|
||||
if (CurrentRunState < RunState.Parsed)
|
||||
if (CurrentRunState <= RunState.Parsed)
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(LoadStaticAssets)} cannot load assets in the '{CurrentRunState}' state.");
|
||||
}
|
||||
|
||||
@@ -68,7 +68,12 @@ public partial class LoggerService : ILoggerService
|
||||
|
||||
public void LogWarning(string message)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (HideUserNames && !Environment.UserName.IsNullOrEmpty())
|
||||
{
|
||||
message = message.Replace(Environment.UserName, "USERNAME");
|
||||
}
|
||||
|
||||
Log($"{message}", Color.Yellow, ServerLog.MessageType.ServerMessage);
|
||||
}
|
||||
|
||||
public void LogMessage(string message, Color? serverColor = null, Color? clientColor = null)
|
||||
@@ -131,7 +136,7 @@ public partial class LoggerService : ILoggerService
|
||||
|
||||
public void LogResults(FluentResults.Result result)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
LogError("LogResults not implemented");
|
||||
}
|
||||
|
||||
public void LogDebug(string message, Color? color = null)
|
||||
|
||||
Reference in New Issue
Block a user