changeset 90:bd2aaa9a61df

Re #50: Complete loading of core XML file * Fix remaining bugs from trying to load UnitEquipmentItem values from wrong element * Add type cast to fix infinite loop
author IBBoard <dev@ibboard.co.uk>
date Sat, 01 Aug 2009 21:40:53 +0000
parents cb3759c3ea19
children 571d8ddc7d9a
files api/Factories/Xml/WarFoundryXmlRaceFactory.cs api/Objects/Unit.cs
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Aug 01 20:04:13 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Aug 01 21:40:53 2009 +0000
@@ -157,8 +157,8 @@
 				if (equipItem!=null)
 				{
 					UnitEquipmentItem unitEquipItem = new UnitEquipmentItem(equipItem);
-					unitEquipItem.MutexGroup = elem.GetAttribute("exclusivityGroup");					
-					unitEquipItem.RoundNumberUp = elem.GetAttribute("roundDirection").Equals("up");
+					unitEquipItem.MutexGroup = equip.GetAttribute("exclusivityGroup");					
+					unitEquipItem.RoundNumberUp = equip.GetAttribute("roundDirection").Equals("up");
 					
 					
 					try
--- a/api/Objects/Unit.cs	Sat Aug 01 20:04:13 2009 +0000
+++ b/api/Objects/Unit.cs	Sat Aug 01 21:40:53 2009 +0000
@@ -273,7 +273,7 @@
 				amount = 0;
 			}
 			
-			SetEquipmentAmount(equip, amount);
+			SetEquipmentAmount(equip, (double)amount);
 		}
 		
 		public void SetEquipmentRatio(UnitEquipmentItem equip, double ratio)