diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index 944a312c99..2055aca26b 100644 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -154,7 +154,12 @@ namespace OpenRA.Editor var z = u + v * template.Size.X; if (tile.TileBitmapBytes[z] != null) Map.MapTiles[u + pos.X, v + pos.Y] = - new TileReference { type = Brush.N, image = (byte)z, index = (byte)z }; + new TileReference + { + type = Brush.N, + index = template.PickAny ? byte.MaxValue : (byte)z, + image = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4)*4) : (byte)z, + }; var ch = new int2((pos.X + u) / ChunkSize, (pos.Y + v) / ChunkSize); if (Chunks.ContainsKey(ch)) @@ -290,7 +295,7 @@ namespace OpenRA.Editor { var tr = Map.MapTiles[u * ChunkSize + i, v * ChunkSize + j]; var tile = TileSet.tiles[tr.type]; - var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0; + var index = (tr.image < tile.TileBitmapBytes.Count) ? tr.image : (byte)0; var rawImage = tile.TileBitmapBytes[index]; for (var x = 0; x < 24; x++) for (var y = 0; y < 24; y++) diff --git a/OpenRA.FileFormats/Map/TileSet.cs b/OpenRA.FileFormats/Map/TileSet.cs index 412dd0e71b..fb4fdd5a56 100644 --- a/OpenRA.FileFormats/Map/TileSet.cs +++ b/OpenRA.FileFormats/Map/TileSet.cs @@ -98,11 +98,11 @@ namespace OpenRA.FileFormats return missingTile; } - public TerrainType GetTerrainType( TileReference r ) + public TerrainType GetTerrainType(TileReference r) { - var tt = walk[ r.type ].TerrainType; + var tt = walk[r.type].TerrainType; TerrainType ret; - if( !tt.TryGetValue( r.image, out ret ) ) + if (!tt.TryGetValue(r.image, out ret)) return 0;// Default zero (walkable) return ret; } diff --git a/mods/cnc/templates.ini b/mods/cnc/templates.ini index ae0e9f4cd0..d7b3fda9e4 100644 --- a/mods/cnc/templates.ini +++ b/mods/cnc/templates.ini @@ -9,6 +9,7 @@ [TEM0] Name=CLEAR1 +pickany=yes width=1 height=1 tiletype0=0 diff --git a/mods/ra/templates.ini b/mods/ra/templates.ini index c3356c6c1c..f02c37a6b9 100644 --- a/mods/ra/templates.ini +++ b/mods/ra/templates.ini @@ -14,6 +14,7 @@ width=1 height=1 Name=CLEAR1 +pickany=yes tiletype0=0 tiletype1=0 tiletype2=0