From eb01aa275b272774c48672a2560455d3fb902a4e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 10 May 2022 18:51:37 -0400 Subject: [PATCH] fix asset propagation for player sprite recolor masks --- docs/release-notes.md | 3 +++ src/SMAPI/Metadata/CoreAssetPropagator.cs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 23783a8a..3ba11edd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -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. diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 12b73515..e014f9a9 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -1017,7 +1017,9 @@ namespace StardewModdingAPI.Metadata foreach (Farmer player in players) { - this.Reflection.GetField>>?>(typeof(FarmerRenderer), "_recolorOffsets").GetValue()?.Remove(player.getTexture()); + var recolorOffsets = this.Reflection.GetField>>?>(typeof(FarmerRenderer), "_recolorOffsets").GetValue(); + recolorOffsets?.Clear(); + player.FarmerRenderer.MarkSpriteDirty(); }