From 3e54ac88579ba202d9bac34ca88c1dcb25f90a64 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 29 Mar 2020 12:08:56 -0400 Subject: [PATCH] fix path segmenting on Linux/Mac in asset propagation --- docs/release-notes.md | 10 +++++++--- src/SMAPI/Metadata/CoreAssetPropagator.cs | 7 ++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index b404f18d..78d9d8bd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,13 @@ ← [README](README.md) # Release notes +## Upcoming release +* For the web UI: + * Updated the JSON validator and Content Patcher schema for Content Patcher 1.13. + +* For modders: + * Fixed asset propagation on Linux/Mac for monster sprites, NPC dialogue, and NPC schedules. + ## 3.4.1 Released 24 March 2020 for Stardew Valley 1.4.1 or later. @@ -8,9 +15,6 @@ Released 24 March 2020 for Stardew Valley 1.4.1 or later. * Asset changes now propagate to NPCs in an event (e.g. wedding sprites). * Fixed mouse input suppression not working in SMAPI 3.4. -* For the web UI: - * Updated the JSON validator and Content Patcher schema for Content Patcher 1.13. - ## 3.4 Released 22 March 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 83e553ff..30b96c1d 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -5,6 +5,7 @@ using System.Linq; using Microsoft.Xna.Framework.Graphics; using Netcode; using StardewModdingAPI.Framework.Reflection; +using StardewModdingAPI.Toolkit.Utilities; using StardewValley; using StardewValley.BellsAndWhistles; using StardewValley.Buildings; @@ -1037,9 +1038,9 @@ namespace StardewModdingAPI.Metadata /// The path to check. private string[] GetSegments(string path) { - if (path == null) - return new string[0]; - return path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + return path != null + ? PathUtilities.GetSegments(path) + : new string[0]; } /// Count the number of segments in a path (e.g. 'a/b' is 2).