From 660e8087a1885fcf48b7d34b4ec726eda0e732d1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 16 Jun 2019 23:16:35 -0400 Subject: [PATCH] update for location change in SDV 1.4 (#638) --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 186cd4ee..9e84c67f 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using StardewModdingAPI.Framework.Reflection; using StardewValley; @@ -15,7 +14,6 @@ using StardewValley.Objects; using StardewValley.Projectiles; using StardewValley.TerrainFeatures; using xTile; -using xTile.ObjectModel; using xTile.Tiles; namespace StardewModdingAPI.Metadata @@ -150,26 +148,9 @@ namespace StardewModdingAPI.Metadata foreach (var entry in new InteriorDoorDictionary(location)) location.interiorDoors.Add(entry); - // update doors (derived from GameLocation.loadObjects) + // update doors location.doors.Clear(); - for (int x = 0; x < location.map.Layers[0].LayerWidth; ++x) - { - for (int y = 0; y < location.map.Layers[0].LayerHeight; ++y) - { - if (location.map.GetLayer("Buildings").Tiles[x, y] != null) - { - location.map.GetLayer("Buildings").Tiles[x, y].Properties.TryGetValue("Action", out PropertyValue action); - if (action != null && action.ToString().Contains("Warp")) - { - string[] strArray = action.ToString().Split(' '); - if (strArray[0] == "WarpCommunityCenter") - location.doors.Add(new Point(x, y), "CommunityCenter"); - else if ((location.Name != "Mountain" || x != 8 || y != 20) && strArray.Length > 2) - location.doors.Add(new Point(x, y), strArray[3]); - } - } - } - } + location.updateDoors(); anyChanged = true; }