diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-12 21:26:12 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-28 00:01:43 -0500 |
commit | 3a3688e09448b95f8b412154de743df6b2297fe9 (patch) | |
tree | 9a1d8baa554007a343690725babae92a8d7d9016 /src/SMAPI/Framework/SCore.cs | |
parent | e16d6e98dca581754023a618b3abe603e7905f44 (diff) | |
download | SMAPI-3a3688e09448b95f8b412154de743df6b2297fe9.tar.gz SMAPI-3a3688e09448b95f8b412154de743df6b2297fe9.tar.bz2 SMAPI-3a3688e09448b95f8b412154de743df6b2297fe9.zip |
use new mod hooks to synchronize tasks
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 95a7ace6..947284a8 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -11,7 +11,6 @@ using System.Runtime.ExceptionServices; using System.Security; using System.Text; using System.Threading; -using System.Threading.Tasks; using Microsoft.Xna.Framework; #if SMAPI_FOR_WINDOWS using Microsoft.Win32; @@ -236,7 +235,7 @@ namespace StardewModdingAPI.Framework monitor: this.Monitor, reflection: this.Reflection, eventManager: this.EventManager, - modHooks: new SModHooks(this.OnNewDayAfterFade), + modHooks: new SModHooks(this.OnNewDayAfterFade, this.Monitor), multiplayer: this.Multiplayer, exitGameImmediately: this.ExitGameImmediately, @@ -650,13 +649,6 @@ namespace StardewModdingAPI.Framework this.Monitor.Log("Game loader done."); } - if (instance.NewDayTask?.Status == TaskStatus.Created) - { - this.Monitor.Log("New day task synchronizing..."); - instance.NewDayTask.RunSynchronously(); - this.Monitor.Log("New day task done."); - } - // While a background task is in progress, the game may make changes to the game // state while mods are running their code. This is risky, because data changes can // conflict (e.g. collection changed during enumeration errors) and data may change @@ -666,7 +658,7 @@ namespace StardewModdingAPI.Framework // a small chance that the task will finish after we defer but before the game checks, // which means technically events should be raised, but the effects of missing one // update tick are negligible and not worth the complications of bypassing Game1.Update. - if (instance.NewDayTask != null || Game1.gameMode == Game1.loadingMode) + if (Game1.gameMode == Game1.loadingMode) { events.UnvalidatedUpdateTicking.RaiseEmpty(); runUpdate(); |