Convert damage modifiers to integer percentages.
This commit is contained in:
@@ -26,6 +26,12 @@ namespace OpenRA.Utility
|
||||
input = "{0}c{1}".F(cells, subcells);
|
||||
}
|
||||
|
||||
static void ConvertFloatArrayToPercentArray(ref string input)
|
||||
{
|
||||
input = string.Join(", ", input.Split(',')
|
||||
.Select(s => ((int)(float.Parse(s) * 100)).ToString()));
|
||||
}
|
||||
|
||||
static void ConvertPxToRange(ref string input)
|
||||
{
|
||||
ConvertPxToRange(ref input, 1, 1);
|
||||
@@ -402,6 +408,16 @@ namespace OpenRA.Utility
|
||||
}
|
||||
}
|
||||
|
||||
// Modifiers were changed to integer percentages
|
||||
if (engineVersion < 20140809)
|
||||
{
|
||||
if (depth == 2 && node.Key == "ClosedDamageMultiplier" && parentKey == "AttackPopupTurreted")
|
||||
ConvertFloatArrayToPercentArray(ref node.Value.Value);
|
||||
|
||||
if (depth == 2 && node.Key == "ArmorModifier" && parentKey == "GainsStatUpgrades")
|
||||
ConvertFloatArrayToPercentArray(ref node.Value.Value);
|
||||
}
|
||||
|
||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user