fix path segmenting on Linux/Mac in asset propagation

This commit is contained in:
Jesse Plamondon-Willard 2020-03-29 12:08:56 -04:00
parent cecd17ec3c
commit 3e54ac8857
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 11 additions and 6 deletions

View File

@ -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.

View File

@ -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
/// <param name="path">The path to check.</param>
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];
}
/// <summary>Count the number of segments in a path (e.g. 'a/b' is 2).</summary>