diff options
author | SinZ <github@361zn.is> | 2022-11-11 22:01:48 +1100 |
---|---|---|
committer | SinZ <github@361zn.is> | 2022-11-11 22:01:48 +1100 |
commit | be84248a9a0a57ee1b2384e63b25fc9bb694fa4d (patch) | |
tree | c6121ca30c2fcc17e0c6323ca5606794df831e67 /src/SMAPI | |
parent | 9ae69245b30f5cc6b52f1159a6e151079b699a10 (diff) | |
download | SMAPI-be84248a9a0a57ee1b2384e63b25fc9bb694fa4d.tar.gz SMAPI-be84248a9a0a57ee1b2384e63b25fc9bb694fa4d.tar.bz2 SMAPI-be84248a9a0a57ee1b2384e63b25fc9bb694fa4d.zip |
Add logic to remove from the multiplayer map cache for asset propagation
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 7 |
1 files changed, 7 insertions, 0 deletions
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<Multiplayer>(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(); |