Bake PickAny tiles on map save. Translate maxvalue index to random tile for backwards compat.
This commit is contained in:
@@ -14,20 +14,11 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public T type;
|
||||
public U index;
|
||||
public U image;
|
||||
|
||||
public TileReference(T t, U i)
|
||||
{
|
||||
type = t;
|
||||
index = i;
|
||||
image = i;
|
||||
}
|
||||
|
||||
public TileReference(T t, U i, U im)
|
||||
{
|
||||
type = t;
|
||||
index = i;
|
||||
image = im;
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return type.GetHashCode() ^ index.GetHashCode(); }
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
Terrain tile;
|
||||
if( Tiles.TryGetValue( r.type, out tile ) )
|
||||
return tile.TileBitmapBytes[ r.image ];
|
||||
return tile.TileBitmapBytes[ r.index ];
|
||||
|
||||
byte[] missingTile = new byte[ TileSize * TileSize ];
|
||||
for( int i = 0 ; i < missingTile.Length ; i++ )
|
||||
@@ -149,7 +149,7 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
var tt = Templates[r.type].Tiles;
|
||||
string ret;
|
||||
if (!tt.TryGetValue(r.image, out ret))
|
||||
if (!tt.TryGetValue(r.index, out ret))
|
||||
return "Clear"; // Default walkable
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user