summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Framework/SGame.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 240e9a97..d3865316 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -5,6 +5,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading;
+using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
@@ -223,7 +224,7 @@ namespace StardewModdingAPI.Framework
return;
}
- // Run loaders synchronously to avoid issues due to mod events triggering
+ // Run async tasks synchronously to avoid issues due to mod events triggering
// concurrently with game code.
if (Game1.currentLoader != null)
{
@@ -233,6 +234,12 @@ namespace StardewModdingAPI.Framework
Game1.currentLoader = null;
this.Monitor.Log("Game loader done.", LogLevel.Trace);
}
+ if (Game1._newDayTask?.Status == TaskStatus.Created)
+ {
+ this.Monitor.Log("New day task synchronising...", LogLevel.Trace);
+ Game1._newDayTask.RunSynchronously();
+ this.Monitor.Log("New day task done.", LogLevel.Trace);
+ }
// 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