fix asset propagation for Gil's portraits
This commit is contained in:
parent
df6e745c6b
commit
4eb68e96ed
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue