# HG changeset patch # User IBBoard # Date 1327259826 0 # Node ID 8811737baebf64d127149950e52d1db531b34a1d # Parent ba6c762cdfc33ce32c0fa770c0e50ca8f18fcf79 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 diff -r ba6c762cdfc3 -r 8811737baebf API/Factories/Xml/WarFoundryXmlRaceFactory.cs --- 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; } diff -r ba6c762cdfc3 -r 8811737baebf data/Empire.race Binary file data/Empire.race has changed