diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-04 17:41:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-04 17:41:45 -0400 |
commit | 4eb68e96ed2b986cf2db621b24f4ebbdd0cf83f1 (patch) | |
tree | b0f3d791ee171d6e0c9deafe46455492e9eba894 /src/SMAPI/Metadata | |
parent | df6e745c6b842290338317ed1d3e969ee222998c (diff) | |
download | SMAPI-4eb68e96ed2b986cf2db621b24f4ebbdd0cf83f1.tar.gz SMAPI-4eb68e96ed2b986cf2db621b24f4ebbdd0cf83f1.tar.bz2 SMAPI-4eb68e96ed2b986cf2db621b24f4ebbdd0cf83f1.zip |
fix asset propagation for Gil's portraits
Diffstat (limited to 'src/SMAPI/Metadata')
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 15 |
1 files changed, 12 insertions, 3 deletions
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) |