summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-10 18:51:37 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-10 18:51:37 -0400
commiteb01aa275b272774c48672a2560455d3fb902a4e (patch)
treeca664fc34d2caab998ff5d8cf73318295d3f233a
parent7a91cf1cd875bc62072571e1b259a10cbacdaaab (diff)
downloadSMAPI-eb01aa275b272774c48672a2560455d3fb902a4e.tar.gz
SMAPI-eb01aa275b272774c48672a2560455d3fb902a4e.tar.bz2
SMAPI-eb01aa275b272774c48672a2560455d3fb902a4e.zip
fix asset propagation for player sprite recolor masks
-rw-r--r--docs/release-notes.md3
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs4
2 files changed, 6 insertions, 1 deletions
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<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();
}