Merge pull request #11641 from abcdefg30/particleDensity

Convert ParticleDensityFactor from a float to an int
This commit is contained in:
Oliver Brakmann
2016-07-15 10:30:57 +02:00
committed by GitHub
4 changed files with 15 additions and 5 deletions

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);
}