Update TS LocalOffsets for new coordinate system.

This commit is contained in:
Paul Chote
2017-05-07 12:46:15 +00:00
parent cf09b99ed8
commit d2973801e4
12 changed files with 48 additions and 36 deletions

View File

@@ -636,9 +636,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
if (engineVersion < 20170507)
{
if (node.Key == "Offset" && parent.Key.StartsWith("WithHarvestOverlay", StringComparison.Ordinal))
RenameNodeKey(node, "LocalOffset");
if (node.Key == "LocalOffset")
{
var orig = FieldLoader.GetValue<WVec[]>(node.Key, node.Value.Value);
var scaled = orig.Select(o => FieldSaver.FormatValue(new WVec(
(int)Math.Round(Math.Sqrt(2) * o.X),
(int)Math.Round(Math.Sqrt(2) * o.Y),
(int)Math.Round(Math.Sqrt(2) * o.Z))));
node.Value.Value = scaled.JoinWith(", ");
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}