Add an upgrade rule

This commit is contained in:
abcdefg30
2016-07-12 22:17:50 +02:00
parent 39d9832b03
commit df5727ad38

View File

@@ -256,6 +256,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
// ParticleDensityFactor was converted from a float to an int
if (engineVersion < 20160713 && node.Key == "WeatherOverlay")
{
var density = node.Value.Nodes.FirstOrDefault(n => n.Key == "ParticleDensityFactor");
if (density != null)
{
var value = float.Parse(density.Value.Value, CultureInfo.InvariantCulture);
value = (int)Math.Round(value * 10000, 0);
density.Value.Value = value.ToString();
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
} }