Skip to content

Commit

Permalink
Remove unused legacy IsWater flag
Browse files Browse the repository at this point in the history
This was planned anyway, we had just forgotten about it when the last blocker was removed.
  • Loading branch information
reaperrr authored and abcdefg30 committed Feb 22, 2018
1 parent 08ad7d7 commit 9107ca3
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion OpenRA.Game/Map/TileSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public class TerrainTypeInfo
public readonly string Type;
public readonly HashSet<string> TargetTypes = new HashSet<string>();
public readonly HashSet<string> AcceptsSmudgeType = new HashSet<string>();
public readonly bool IsWater = false; // TODO: Remove this
public readonly Color Color;
public readonly bool RestrictPlayerColor = false;
public readonly string CustomCursor;
Expand Down
3 changes: 0 additions & 3 deletions OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ void IUtilityCommand.Run(Utility utility, string[] args)
metadata.AppendLine("\t\tType: {0}".F(terrainType));

if (terrainType == "Water")
{
metadata.AppendLine("\t\tTargetTypes: Water");
metadata.AppendLine("\t\tIsWater: True");
}
else
metadata.AppendLine("\t\tTargetTypes: Ground");

Expand Down
11 changes: 11 additions & 0 deletions OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,17 @@ internal static void UpgradeTileset(ModData modData, int engineVersion, ref List
}
}

// Removed IsWater.
if (engineVersion < 20180222)
{
if (node.Key == "TerrainType" || node.Key.StartsWith("TerrainType@", StringComparison.Ordinal))
{
var isWater = node.Value.Nodes.FirstOrDefault(n => n.Key == "IsWater");
if (isWater != null)
node.Value.Nodes.Remove(isWater);
}
}

UpgradeTileset(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}
Expand Down
1 change: 0 additions & 1 deletion mods/cnc/tilesets/desert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5DA5CE
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/cnc/tilesets/jungle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/cnc/tilesets/snow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/cnc/tilesets/temperat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/cnc/tilesets/winter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/d2k/tilesets/arrakis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Terrain:
TerrainType@Ice:
Type: Ice
TargetTypes: Ground
IsWater: True
Color: FFFFFF
TerrainType@Rock:
Type: Rock
Expand Down
1 change: 0 additions & 1 deletion mods/ra/tilesets/desert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5DA5CE
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/ra/tilesets/snow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/ra/tilesets/temperat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ Terrain:
TerrainType@Water:
Type: Water
TargetTypes: Water
IsWater: True
Color: 5C74A4
RestrictPlayerColor: true

Expand Down
1 change: 0 additions & 1 deletion mods/ts/tilesets/snow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Terrain:
Type: Water
Color: 3D4148
TargetTypes: Water
IsWater: True
RestrictPlayerColor: true
TerrainType@DirtRoad:
Type: DirtRoad
Expand Down
1 change: 0 additions & 1 deletion mods/ts/tilesets/temperate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Terrain:
Type: Water
Color: 745537
TargetTypes: Water
IsWater: True
RestrictPlayerColor: true
TerrainType@DirtRoad:
Type: DirtRoad
Expand Down

0 comments on commit 9107ca3

Please sign in to comment.