changeset 204:3ef067225dc3

Fixes #208: equipmentslot limit issues * Construct units properly by using the UnitEquipmentUtil methods to get the actual minimum amount based on the slot limits as well
author IBBoard <dev@ibboard.co.uk>
date Sun, 08 Nov 2009 20:45:45 +0000
parents df4e56e2ee71
children c0edb72a10ba
files api/Objects/Unit.cs api/Objects/UnitEquipmentItem.cs
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/api/Objects/Unit.cs	Fri Nov 06 20:48:07 2009 +0000
+++ b/api/Objects/Unit.cs	Sun Nov 08 20:45:45 2009 +0000
@@ -92,11 +92,11 @@
 						
 						if (minLimit is IPercentageLimit)
 						{
-							SetEquipmentRatio(unitEquip, ((IPercentageLimit)minLimit).Percentage);
+							SetEquipmentRatio(unitEquip, UnitEquipmentUtil.GetMinEquipmentPercentage(this, unitEquip));
 						}
 						else
 						{
-							SetEquipmentAmount(unitEquip, minLimit.GetLimit(this.Size));
+							SetEquipmentAmount(unitEquip, UnitEquipmentUtil.GetMinEquipmentCount(this, unitEquip));
 						}
 					}
 				}
--- a/api/Objects/UnitEquipmentItem.cs	Fri Nov 06 20:48:07 2009 +0000
+++ b/api/Objects/UnitEquipmentItem.cs	Sun Nov 08 20:45:45 2009 +0000
@@ -176,7 +176,7 @@
 						limit = minLimit;
 					}
 					else
-					{
+					{
 						limit = new SimpleRoundedPercentageLimit(100, false);
 					}
 				}