From e9fd21d1e579af975e437edb0d9c8ffb44cd658d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 8 May 2010 22:00:34 +1200 Subject: [PATCH] oh. --- OpenRA.Editor/Form1.cs | 2 +- OpenRA.Editor/Surface.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 };