Upgrade rule for GravityBomb velocity/accel changes
This commit is contained in:
@@ -624,6 +624,29 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
node.Key = "TrackTarget";
|
||||
}
|
||||
|
||||
// Refactor GravityBomb Speed WDist to Velocity WVec and Acceleration from vertical WDist to vector
|
||||
if (engineVersion < 20170329)
|
||||
{
|
||||
var projectile = node.Value.Nodes.FirstOrDefault(n => n.Key == "Projectile");
|
||||
if (projectile != null && projectile.Value.Value == "GravityBomb")
|
||||
{
|
||||
var speedNode = projectile.Value.Nodes.FirstOrDefault(x => x.Key == "Speed");
|
||||
if (speedNode != null)
|
||||
{
|
||||
var oldWDistSpeed = FieldLoader.GetValue<string>("Speed", speedNode.Value.Value);
|
||||
speedNode.Value.Value = "0, 0, -" + oldWDistSpeed;
|
||||
speedNode.Key = "Velocity";
|
||||
}
|
||||
|
||||
var accelNode = projectile.Value.Nodes.FirstOrDefault(x => x.Key == "Acceleration");
|
||||
if (accelNode != null)
|
||||
{
|
||||
var oldWDistAccel = FieldLoader.GetValue<string>("Acceleration", accelNode.Value.Value);
|
||||
accelNode.Value.Value = "0, 0, -" + oldWDistAccel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user