diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-23 22:32:57 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-23 22:32:57 -0400 |
commit | 93475bab7fe692773350e227e1eae55c567ae8bf (patch) | |
tree | 199bef41ba5a029e28e5a0d8ef115518db8716b3 | |
parent | 7ca5efbbc576f3c6c43493654b2a0ac040fd4f31 (diff) | |
download | SMAPI-93475bab7fe692773350e227e1eae55c567ae8bf.tar.gz SMAPI-93475bab7fe692773350e227e1eae55c567ae8bf.tar.bz2 SMAPI-93475bab7fe692773350e227e1eae55c567ae8bf.zip |
fix asset changes not propagating to NPCs in an event
-rw-r--r-- | docs/release-notes.md | 4 | ||||
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 5a5e24d4..7474cc32 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,10 @@ ← [README](README.md) # Release notes +## Upcoming release +* For modders: + * Fixed asset changes not propagating to NPCs in an event (e.g. wedding sprites). + ## 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 8d5ad3ab..83e553ff 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -949,7 +949,14 @@ namespace StardewModdingAPI.Metadata /// <summary>Get all NPCs in the game (excluding farm animals).</summary> private IEnumerable<NPC> GetCharacters() { - return this.GetLocations().SelectMany(p => p.characters); + foreach (NPC character in this.GetLocations().SelectMany(p => p.characters)) + yield return character; + + if (Game1.CurrentEvent?.actors != null) + { + foreach (NPC character in Game1.CurrentEvent.actors) + yield return character; + } } /// <summary>Get all farm animals in the game.</summary> |