diff api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 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 89e26d51afc2
children 78f7456f6419
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)
 					{