From 8ff41110275facadf6dca2814047e8aa6f4a26fa Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 7 Dec 2018 16:17:45 -0500 Subject: fix crash when constucting buildings that have an interior --- .../Framework/StateTracking/WorldLocationsTracker.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs index d9d598f8..930a8102 100644 --- a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs +++ b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs @@ -62,9 +62,13 @@ namespace StardewModdingAPI.Framework.StateTracking /// Update the current value if needed. public void Update() { - // detect added/removed locations + // update watchers this.LocationListWatcher.Update(); this.MineLocationListWatcher.Update(); + foreach (LocationTracker watcher in this.Locations) + watcher.Update(); + + // detect added/removed locations if (this.LocationListWatcher.IsChanged) { this.Remove(this.LocationListWatcher.Removed); @@ -77,14 +81,10 @@ namespace StardewModdingAPI.Framework.StateTracking } // detect building changed - foreach (LocationTracker watcher in this.Locations.ToArray()) + foreach (LocationTracker watcher in this.Locations.Where(p => p.BuildingsWatcher.IsChanged).ToArray()) { - watcher.Update(); - if (watcher.BuildingsWatcher.IsChanged) - { - this.Remove(watcher.BuildingsWatcher.Removed); - this.Add(watcher.BuildingsWatcher.Added); - } + this.Remove(watcher.BuildingsWatcher.Removed); + this.Add(watcher.BuildingsWatcher.Added); } // detect building interiors changed (e.g. construction completed) -- cgit From 085b1be28cc9ecc323f9a29bc319c43a3cfd13e5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 7 Dec 2018 16:29:06 -0500 Subject: fix error when a location doesn't have a map asset key --- docs/release-notes.md | 1 + src/SMAPI/Metadata/CoreAssetPropagator.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/docs/release-notes.md b/docs/release-notes.md index 979c5d0c..9047ae88 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,7 @@ ## 2.9.1 * For players: * Fixed crash in SMAPI 2.9 when constructing certain buildings. + * Fixed error when a map asset is reloaded in rare cases. ## 2.9 * For players: diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index d273c251..90629d7f 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -92,7 +92,7 @@ namespace StardewModdingAPI.Metadata bool anyChanged = false; foreach (GameLocation location in this.GetLocations()) { - if (this.GetNormalisedPath(location.mapPath.Value) == key) + if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.GetNormalisedPath(location.mapPath.Value) == key) { this.Reflection.GetMethod(location, "reloadMap").Invoke(); this.Reflection.GetMethod(location, "updateWarps").Invoke(); -- cgit From 2b3fb71f6a67cb275a71c5f86040db3286310364 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 7 Dec 2018 16:32:17 -0500 Subject: update for release --- build/GlobalAssemblyInfo.cs | 4 ++-- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/build/GlobalAssemblyInfo.cs b/build/GlobalAssemblyInfo.cs index 207c11c3..c2841c72 100644 --- a/build/GlobalAssemblyInfo.cs +++ b/build/GlobalAssemblyInfo.cs @@ -1,5 +1,5 @@ using System.Reflection; [assembly: AssemblyProduct("SMAPI")] -[assembly: AssemblyVersion("2.9.0")] -[assembly: AssemblyFileVersion("2.9.0")] +[assembly: AssemblyVersion("2.9.1")] +[assembly: AssemblyFileVersion("2.9.1")] diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index c723d845..fa977039 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "2.9.0", + "Version": "2.9.1", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "2.9.0" + "MinimumApiVersion": "2.9.1" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index b6aa4149..1875adca 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "2.9.0", + "Version": "2.9.1", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "2.9.0" + "MinimumApiVersion": "2.9.1" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 6a1cd188..959ab3c7 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -29,7 +29,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.9.0"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.9.1"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.3.32"); -- cgit