Migrated Minelayer.MinefieldDepth to use WDist instead of float

This commit is contained in:
reaperrr
2016-03-24 18:41:42 +01:00
parent 251b1b44d4
commit ade49ba1be
2 changed files with 19 additions and 3 deletions

View File

@@ -676,6 +676,22 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// Migrated Minelayer.MinefieldDepth to use WDist instead of float
if (engineVersion < 20160325)
{
if (node.Key.StartsWith("Minelayer"))
{
var depthNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "MinefieldDepth");
if (depthNode != null)
{
// The MinefieldDepth value is now a WDist, so multiply the float value with 1024.
var oldValue = FieldLoader.GetValue<float>("MinefieldDepth", depthNode.Value.Value);
var newValue = (int)(oldValue * 1024);
depthNode.Value.Value = newValue.ToString();
}
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}