fix asset propagation for player sprite recolor masks

This commit is contained in:
Jesse Plamondon-Willard 2022-05-10 18:51:37 -04:00
parent 7a91cf1cd8
commit eb01aa275b
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,9 @@
# Release notes
## Upcoming release
* For mod authors:
* Fixed asset propagation for player sprites not fully updating recolor masks in some cases.
* For the web UI:
* Updated the JSON validator/schema for Content Patcher 1.26.0.

View File

@ -1017,7 +1017,9 @@ namespace StardewModdingAPI.Metadata
foreach (Farmer player in players)
{
this.Reflection.GetField<Dictionary<string, Dictionary<int, List<int>>>?>(typeof(FarmerRenderer), "_recolorOffsets").GetValue()?.Remove(player.getTexture());
var recolorOffsets = this.Reflection.GetField<Dictionary<string, Dictionary<int, List<int>>>?>(typeof(FarmerRenderer), "_recolorOffsets").GetValue();
recolorOffsets?.Clear();
player.FarmerRenderer.MarkSpriteDirty();
}