changeset 450:8811737baebf

Fixes #352: Test/fix cyclic references in unit types * Tell the Race it has a new UnitType earlier to resolve load loops * Update example data file to one that uses all requirements, but caused cyclic issues
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Jan 2012 19:17:06 +0000
parents ba6c762cdfc3
children 676f5ce04176
files API/Factories/Xml/WarFoundryXmlRaceFactory.cs data/Empire.race
diffstat 2 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/API/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sat Jan 21 20:40:28 2012 +0000
+++ b/API/Factories/Xml/WarFoundryXmlRaceFactory.cs	Sun Jan 22 19:17:06 2012 +0000
@@ -156,6 +156,7 @@
 			string name = elem.GetAttribute("typeName");
 			UnitType type = new UnitType(id, name, parentRace);
 			LoadCoreValuesForUnitType(elem, type);
+			parentRace.AddUnitType(type);
 			LoadEquipmentSlotsForUnitType(elem, type);
 			LoadEquipmentForUnitType(elem, type);
 			LoadAbilitiesForUnitType(elem, type);
@@ -163,7 +164,6 @@
 			LoadRequirementsForUnitType(elem, type);
 			LoadExtraDataForUnitType(elem, type);
 			LoadNotesForUnitType(elem, type);
-			parentRace.AddUnitType(type);
 			return type;
 		}
 
Binary file data/Empire.race has changed