diff options
-rw-r--r-- | docs/release-notes.md | 3 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModHelpers/ContentHelper.cs | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 513423ca..6b552395 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -17,7 +17,8 @@ These changes have not been released yet. * Fixed some assets not updated when you switch language to English. * Fixed lag in some cases due to incorrect asset caching when playing in non-English. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. - * Fixed seasonal tilesheet issues when a mod reloads a map. + * Fixed map reloads resetting tilesheet seasons. + * Fixed outdoor tilesheets being seasonalised when added to an indoor location. * For modders: * Added support for content pack translations. diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs index e02748d2..5c4c3bca 100644 --- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs @@ -13,6 +13,7 @@ using StardewModdingAPI.Toolkit.Utilities; using StardewValley; using xTile; using xTile.Format; +using xTile.ObjectModel; using xTile.Tiles; namespace StardewModdingAPI.Framework.ModHelpers @@ -247,6 +248,7 @@ namespace StardewModdingAPI.Framework.ModHelpers return; relativeMapPath = this.ModContentManager.AssertAndNormaliseAssetName(relativeMapPath); // Mono's Path.GetDirectoryName doesn't handle Windows dir separators string relativeMapFolder = Path.GetDirectoryName(relativeMapPath) ?? ""; // folder path containing the map, relative to the mod folder + bool isOutdoors = map.Properties.TryGetValue("Outdoors", out PropertyValue outdoorsProperty) && outdoorsProperty != null; // fix tilesheets foreach (TileSheet tilesheet in map.TileSheets) @@ -259,7 +261,7 @@ namespace StardewModdingAPI.Framework.ModHelpers // get seasonal name (if applicable) string seasonalImageSource = null; - if (Context.IsSaveLoaded && Game1.currentSeason != null) + if (isOutdoors && Context.IsSaveLoaded && Game1.currentSeason != null) { string filename = Path.GetFileName(imageSource) ?? throw new InvalidOperationException($"The '{imageSource}' tilesheet couldn't be loaded: filename is unexpectedly null."); bool hasSeasonalPrefix = |