diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index ae653f04ee..ea9e4f5195 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -110,7 +110,7 @@ namespace OpenRA.Editor for (var u = 0; u < template.Size.X; u++) for (var v = 0; v < template.Size.Y; v++) - if (template.TerrainType.ContainsKey(u + v * template.Size.X)) + if (tile.TileBitmapBytes[u + v * template.Size.X] != null) { var rawImage = tile.TileBitmapBytes[u + v * template.Size.X]; for (var i = 0; i < 24; i++) diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index 4daebeae8d..9bed52bf17 100644 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -65,6 +65,7 @@ namespace OpenRA.Editor if (e.Button == MouseButtons.Left && Brush.Second != null) { // change the bits in the map + var tile = TileSet.tiles[Brush.First]; var template = TileSet.walk[Brush.First]; var pos = GetBrushLocation(); @@ -74,7 +75,7 @@ namespace OpenRA.Editor if (Map.IsInMap(new int2(u, v) + pos)) { var z = u + v * template.Size.X; - if (template.TerrainType.ContainsKey(z)) + if (tile.TileBitmapBytes[z] != null) Map.MapTiles[u + pos.X, v + pos.Y] = new TileReference { type = Brush.First, image = (byte)z, index = (byte)z };