changeset 219:f609bcf7035b

Fixes #222: decimal comma/point not handled correctly (again?) in costMultiplier * Replace two "type.Parse" calls with XmlTools calls All decimals in WarFoundry should use the decimal point (or "period" to Americans) rather than the decimal comma because that's what XML uses in its default type definitions
author IBBoard <dev@ibboard.co.uk>
date Sat, 28 Nov 2009 16:40:27 +0000
parents a1a6b527cd70
children 7441a62c5a06
files api/Factories/Xml/WarFoundryXmlRaceFactory.cs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Nov 28 16:22:11 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Nov 28 16:40:27 2009 +0000
@@ -287,7 +287,7 @@
 					
 					try
 					{
-						unitEquipItem.IsRequired = bool.Parse(equip.GetAttribute("required"));
+						unitEquipItem.IsRequired = XmlTools.GetBoolValueFromAttribute(equip, "required");
 					}
 					catch(FormatException e)
 					{
@@ -296,7 +296,7 @@
 					
 					try
 					{
-						unitEquipItem.CostMultiplier = double.Parse(equip.GetAttribute("costMultiplier"));
+						unitEquipItem.CostMultiplier = XmlTools.GetDoubleValueFromAttribute(equip, "costMultiplier");
 					}
 					catch (FormatException e)
 					{