Skip to content

Commit

Permalink
Use ShutdownRan
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra authored and Banane9 committed Nov 23, 2024
1 parent 0b07abe commit 0ca5d3d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MonkeyLoader.Resonite.Integration/ResoniteMonkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ protected ResoniteMonkey()

bool IResoniteMonkeyInternal.EngineInit()
{
if (Failed)
if (ShutdownRan)
{
Logger.Warn(() => "Monkey already failed Run, skipping OnEngineInit!");
Logger.Warn(() => "Monkey shutdown already ran, skipping OnEngineInit!");
return false;
}

Expand All @@ -89,7 +89,6 @@ bool IResoniteMonkeyInternal.EngineInit()
{
EngineInitFailed = true;
Logger.Warn(() => "OnEngineInit failed!");
Shutdown(false);
}
}
catch (Exception ex)
Expand All @@ -105,9 +104,9 @@ bool IResoniteMonkeyInternal.EngineInit()

bool IResoniteMonkeyInternal.EngineReady()
{
if (EngineInitFailed)
if (ShutdownRan)
{
Logger.Warn(() => "Monkey already failed OnEngineInit, skipping OnEngineReady!");
Logger.Warn(() => "Monkey shutdown already ran, skipping OnEngineReady!");
return false;
}

Expand All @@ -123,7 +122,6 @@ bool IResoniteMonkeyInternal.EngineReady()
{
EngineReadyFailed = true;
Logger.Warn(() => "OnEngineReady failed!");
Shutdown(false);
}
}
catch (Exception ex)
Expand Down

0 comments on commit 0ca5d3d

Please sign in to comment.