diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-16 18:56:56 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-16 18:56:56 -0400 |
commit | 749f0321f01b2f2ad865f31ab6f447c5a590fdd0 (patch) | |
tree | 186152a5f62e4eefe0cd379e4923098d554f58b6 /src/SMAPI/Context.cs | |
parent | 6805c90e2cdac734341b692298670b0beb50faa6 (diff) | |
download | SMAPI-749f0321f01b2f2ad865f31ab6f447c5a590fdd0.tar.gz SMAPI-749f0321f01b2f2ad865f31ab6f447c5a590fdd0.tar.bz2 SMAPI-749f0321f01b2f2ad865f31ab6f447c5a590fdd0.zip |
avoid asset propagation into the world if it's unloaded
Propagating changes into world locations has no effect at this point (since they'll just be recreated when a save is loaded), and can noticeably impact performance.
Diffstat (limited to 'src/SMAPI/Context.cs')
-rw-r--r-- | src/SMAPI/Context.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs index b1b33cd6..5f70d0f7 100644 --- a/src/SMAPI/Context.cs +++ b/src/SMAPI/Context.cs @@ -38,6 +38,9 @@ namespace StardewModdingAPI set => Context.LoadStageForScreen.Value = value; } + /// <summary>Whether the in-game world is completely unloaded and not in the process of being loaded. The world may still exist in memory at this point, but should be ignored.</summary> + internal static bool IsWorldFullyUnloaded => Context.LoadStage == LoadStage.ReturningToTitle || Context.LoadStage == LoadStage.None; + /********* ** Accessors |