diff options
-rw-r--r-- | docs/release-notes.md | 4 | ||||
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 15 |
2 files changed, 16 insertions, 3 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 97aabd37..cb177ca0 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,10 @@ ← [README](README.md) # Release notes +## Upcoming released +* For modders: + * Fixed asset propagation for Gil's portraits. + ## 3.5 Released 27 April 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 0a14086b..fa6541cb 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -816,9 +816,18 @@ namespace StardewModdingAPI.Metadata where key != null && lookup.Contains(key) select new { Npc = npc, Key = key } ) - .ToArray(); - if (!characters.Any()) - return; + .ToList(); + + // special case: Gil is a private NPC field on the AdventureGuild class (only used for the portrait) + { + string gilKey = this.NormalizeAssetNameIgnoringEmpty("Portraits/Gil"); + if (lookup.Contains(gilKey)) + { + GameLocation adventureGuild = Game1.getLocationFromName("AdventureGuild"); + if (adventureGuild != null) + characters.Add(new { Npc = this.Reflection.GetField<NPC>(adventureGuild, "Gil").GetValue(), Key = gilKey }); + } + } // update portrait foreach (var target in characters) |