fix asset changes not propagating to NPCs in an event

This commit is contained in:
Jesse Plamondon-Willard 2020-03-23 22:32:57 -04:00
parent 7ca5efbbc5
commit 93475bab7f
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 12 additions and 1 deletions

View File

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

View File

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