From 6b6ccb87de4d669f66e0c1a5b9270607db16484c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 6 Feb 2019 20:47:57 -0500 Subject: fix error with custom map tilesheets in some cases Specifically, when a custom map has a seasonal tilesheet which only exists the Content/Maps folder and already matches the current season. --- docs/release-notes.md | 1 + src/SMAPI/Framework/ModHelpers/ContentHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index e64271bc..7b6ef89b 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -17,6 +17,7 @@ * For modders: * Asset changes are now propagated into the parsed save being loaded if applicable. + * Fixed error loading custom map tilesheets in some cases. * Fixed `Constants.SaveFolderName` and `CurrentSavePath` not available during early load stages when using `Specialised.LoadStageChanged` event. * Fixed `LoadStage.SaveParsed` raised before the parsed save data is available. * Fixed 'unknown mod' deprecation warnings showing the wrong stack trace. diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs index dac627ba..7c353003 100644 --- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs @@ -319,7 +319,7 @@ namespace StardewModdingAPI.Framework.ModHelpers foreach (string candidateKey in new[] { imageSource, $@"Maps\{imageSource}" }) { string contentKey = candidateKey.EndsWith(".png") - ? candidateKey.Substring(0, imageSource.Length - 4) + ? candidateKey.Substring(0, candidateKey.Length - 4) : candidateKey; try -- cgit