From be84248a9a0a57ee1b2384e63b25fc9bb694fa4d Mon Sep 17 00:00:00 2001 From: SinZ Date: Fri, 11 Nov 2022 22:01:48 +1100 Subject: [PATCH] Add logic to remove from the multiplayer map cache for asset propagation --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 1ef9a8f2..d94fe2ae 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -1166,6 +1166,13 @@ namespace StardewModdingAPI.Metadata GameLocation location = locationInfo.Location; Vector2? playerPos = Game1.player?.Position; + // clear cachedMultiplayerMaps so Asset Propegation works on farmhands and Map edits can be applied after an initial load + if (!Game1.IsMasterGame) + { + var multiplayer = this.Reflection.GetField(typeof(Game1), "multiplayer").GetValue(); + multiplayer.cachedMultiplayerMaps.Remove(locationInfo.Location.NameOrUniqueName); + } + // reload map location.interiorDoors.Clear(); // prevent errors when doors try to update tiles which no longer exist location.reloadMap();