This commit is contained in:
Chris Forbes
2010-05-08 22:00:34 +12:00
parent 5bcebade32
commit e9fd21d1e5
2 changed files with 3 additions and 2 deletions

View File

@@ -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++)

View File

@@ -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<ushort, byte> { type = Brush.First, image = (byte)z, index = (byte)z };