fix error on Mac when a custom map references a vanilla tilesheet that only exists under Content/Maps

This commit is contained in:
Jesse Plamondon-Willard 2019-03-25 18:59:36 -04:00
parent 2800f7a931
commit 5d0cba90a1
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
These changes have not been released yet. These changes have not been released yet.
* For players: * For players:
* Fixed error when a custom map references certain vanilla tilesheets on MacOS.
* Fixed compatibility with Arch Linux. * Fixed compatibility with Arch Linux.
## 2.11.1 ## 2.11.1

View File

@ -316,7 +316,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
// check relative to content folder // check relative to content folder
{ {
foreach (string candidateKey in new[] { imageSource, $@"Maps\{imageSource}" }) foreach (string candidateKey in new[] { imageSource, Path.Combine("Maps", imageSource) })
{ {
string contentKey = candidateKey.EndsWith(".png") string contentKey = candidateKey.EndsWith(".png")
? candidateKey.Substring(0, candidateKey.Length - 4) ? candidateKey.Substring(0, candidateKey.Length - 4)