Apply all float removal upgrade rules on the same engine version

This commit is contained in:
reaperrr
2016-03-28 17:29:29 +02:00
parent 33f26e05e1
commit d25d9e3d7e

View File

@@ -644,9 +644,10 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Key = "ReloadDelay"; node.Key = "ReloadDelay";
} }
// Migrated ProductionQueue BuildSpeed to use int percentage instead of float // Got rid of most remaining usages of float in a bid to further reduce desync risk
if (engineVersion < 20160325) if (engineVersion < 20160328)
{ {
// Migrated ProductionQueue BuildSpeed to use int percentage instead of float
if (node.Key.StartsWith("ProductionQueue") || node.Key.StartsWith("ClassicProductionQueue")) if (node.Key.StartsWith("ProductionQueue") || node.Key.StartsWith("ClassicProductionQueue"))
{ {
var buildSpeedNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "BuildSpeed"); var buildSpeedNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "BuildSpeed");
@@ -658,11 +659,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
buildSpeedNode.Value.Value = newValue.ToString(); buildSpeedNode.Value.Value = newValue.ToString();
} }
} }
}
// Migrated StrategicVictoryConditions RatioRequired to use int percentage instead of float // Migrated StrategicVictoryConditions RatioRequired to use int percentage instead of float
if (engineVersion < 20160325)
{
if (node.Key.StartsWith("StrategicVictoryConditions")) if (node.Key.StartsWith("StrategicVictoryConditions"))
{ {
var ratioNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "RatioRequired"); var ratioNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "RatioRequired");
@@ -674,11 +672,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
ratioNode.Value.Value = newValue.ToString(); ratioNode.Value.Value = newValue.ToString();
} }
} }
}
// Migrated Minelayer.MinefieldDepth to use WDist instead of float // Migrated Minelayer.MinefieldDepth to use WDist instead of float
if (engineVersion < 20160325)
{
if (node.Key.StartsWith("Minelayer")) if (node.Key.StartsWith("Minelayer"))
{ {
var depthNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "MinefieldDepth"); var depthNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "MinefieldDepth");
@@ -690,11 +685,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
depthNode.Value.Value = newValue.ToString(); depthNode.Value.Value = newValue.ToString();
} }
} }
}
// Migrated SelfHealing to use int percentage instead of float // Migrated SelfHealing to use int percentage instead of float
if (engineVersion < 20160325)
{
if (node.Key == "SelfHealing") if (node.Key == "SelfHealing")
{ {
var healIfBelowNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "HealIfBelow"); var healIfBelowNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "HealIfBelow");
@@ -706,11 +698,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
healIfBelowNode.Value.Value = newValue.ToString(); healIfBelowNode.Value.Value = newValue.ToString();
} }
} }
}
// Migrated EmitInfantryOnSell to use int percentage instead of float // Migrated EmitInfantryOnSell to use int percentage instead of float
if (engineVersion < 20160324)
{
if (node.Key == "EmitInfantryOnSell") if (node.Key == "EmitInfantryOnSell")
{ {
var valueNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "ValuePercent"); var valueNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "ValuePercent");
@@ -734,11 +723,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
minHPNode.Value.Value = newValue.ToString(); minHPNode.Value.Value = newValue.ToString();
} }
} }
}
// Migrated Captures and Capturable to use int percentage instead of float // Migrated Captures and Capturable to use int percentage instead of float
if (engineVersion < 20160325)
{
if (node.Key == "Captures") if (node.Key == "Captures")
{ {
var sabotageHPRemNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "SabotageHPRemoval"); var sabotageHPRemNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "SabotageHPRemoval");