diff api/Objects/Unit.cs @ 149:c01366bd1627

Fixes #181: Unit points costs don't always include equipment * Make setting initial equipment use the public API so that it triggers the correct cost calculation changes
author IBBoard <dev@ibboard.co.uk>
date Sat, 26 Sep 2009 10:15:07 +0000
parents 7f13ffcb8765
children 1d13820b3d96
line wrap: on
line diff
--- a/api/Objects/Unit.cs	Sat Sep 26 10:14:04 2009 +0000
+++ b/api/Objects/Unit.cs	Sat Sep 26 10:15:07 2009 +0000
@@ -86,12 +86,12 @@
 					if (CanEquipWithItem(unitEquip))
 					{
 						if (unitEquip.IsRatioLimit)
-						{
-							equipment[unitEquip] = new UnitEquipmentRatioSelection(this, unitEquip);
+						{
+							SetEquipmentRatio(unitEquip, unitEquip.MinPercentage);
 						}
 						else
-						{
-							equipment[unitEquip] = new UnitEquipmentNumericSelection(this, unitEquip);
+						{
+							SetEquipmentAmount(unitEquip, unitEquip.MinNumber);
 						}
 					}
 				}