summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-05-25 01:59:32 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 17:59:13 -0400
commitd4e09c5a8524fad43e2ecf94ade86673a94b85a5 (patch)
tree5480bcfc2a4679494cae0ffa7053e3332b8c8256 /src/SMAPI
parent24160cacdce0b2e31a3f7dc130fe84cb164bcf19 (diff)
downloadSMAPI-d4e09c5a8524fad43e2ecf94ade86673a94b85a5.tar.gz
SMAPI-d4e09c5a8524fad43e2ecf94ade86673a94b85a5.tar.bz2
SMAPI-d4e09c5a8524fad43e2ecf94ade86673a94b85a5.zip
fix tilesheets seasonalised when loading an indoor map
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs4
1 files changed, 3 insertions, 1 deletions
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 =