From 27e3812fd2663eea451c9918c0d8c124eba46fd1 Mon Sep 17 00:00:00 2001 From: Rampastring Date: Tue, 18 Jun 2024 09:09:13 +0300 Subject: [PATCH] Only consider TileSets with AllowToPlace=yes when looking up connected tiles --- src/TSMapEditor/Mutations/Classes/DrawCliffMutation.cs | 2 +- src/TSMapEditor/UI/Windows/MainMenuWindows/MapSetup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TSMapEditor/Mutations/Classes/DrawCliffMutation.cs b/src/TSMapEditor/Mutations/Classes/DrawCliffMutation.cs index fbd289f9..d1eb237e 100644 --- a/src/TSMapEditor/Mutations/Classes/DrawCliffMutation.cs +++ b/src/TSMapEditor/Mutations/Classes/DrawCliffMutation.cs @@ -118,7 +118,7 @@ private void PlaceCliffs(CliffAStarNode endNode) { if (node.Tile != null) { - var tileSet = MutationTarget.Map.TheaterInstance.Theater.FindTileSet(node.Tile.TileSetName); + var tileSet = MutationTarget.Map.TheaterInstance.Theater.TileSets.Find(ts => ts.SetName == node.Tile.TileSetName && ts.AllowToPlace); if (tileSet != null) { int tileIndex; diff --git a/src/TSMapEditor/UI/Windows/MainMenuWindows/MapSetup.cs b/src/TSMapEditor/UI/Windows/MainMenuWindows/MapSetup.cs index 30e388b2..298a5c21 100644 --- a/src/TSMapEditor/UI/Windows/MainMenuWindows/MapSetup.cs +++ b/src/TSMapEditor/UI/Windows/MainMenuWindows/MapSetup.cs @@ -158,7 +158,7 @@ private static void FillConnectedTileFoundations(TheaterGraphics theaterGraphics cliffTypeTile.Foundation = new HashSet(); int firstTileIndexWithinSet = cliffTypeTile.IndicesInTileSet[0]; - var tileSet = theaterGraphics.Theater.TileSets.Find(ts => ts.SetName == cliffTypeTile.TileSetName); + var tileSet = theaterGraphics.Theater.TileSets.Find(ts => ts.SetName == cliffTypeTile.TileSetName && ts.AllowToPlace); if (tileSet == null) { throw new INIConfigException($"Unable to find TileSet \"{cliffTypeTile.TileSetName}\" " +