Upgrade rule for Missile.TerrainHeightAware

This commit is contained in:
reaperrr
2017-07-13 02:44:45 +02:00
parent 7e8f920bc1
commit ace353cb84
4 changed files with 15 additions and 0 deletions

View File

@@ -972,6 +972,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// Made Missile terrain height checks disableable and disabled by default
if (engineVersion < 20170713)
{
var gridMaxHeight = modData.Manifest.Get<MapGrid>().MaximumTerrainHeight;
if (gridMaxHeight > 0)
{
var projectile = node.Value.Nodes.FirstOrDefault(n => n.Key == "Projectile");
if (projectile != null && projectile.Value.Value == "Missile")
projectile.Value.Nodes.Add(new MiniYamlNode("TerrainHeightAware", "true"));
}
}
UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}