Add logic to remove from the multiplayer map cache for asset propagation

This commit is contained in:
SinZ 2022-11-11 22:01:48 +11:00
parent 9ae69245b3
commit be84248a9a
1 changed files with 7 additions and 0 deletions

View File

@ -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();