summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-06 20:47:57 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:44:31 -0500
commit6b6ccb87de4d669f66e0c1a5b9270607db16484c (patch)
tree2e2d67ce5f2e285d246f74d4a904a0dea822ffc1
parent1d25edc2a5a81b52c8de8ce98725de6705e8bbb3 (diff)
downloadSMAPI-6b6ccb87de4d669f66e0c1a5b9270607db16484c.tar.gz
SMAPI-6b6ccb87de4d669f66e0c1a5b9270607db16484c.tar.bz2
SMAPI-6b6ccb87de4d669f66e0c1a5b9270607db16484c.zip
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.
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs2
2 files changed, 2 insertions, 1 deletions
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