changeset 209:1cde49671c8b

Re #209: equipmentslot Value problem * Remove "calc percentage from numeric" as it can give us results outside the allowed range - UIs should check that they're not trying to use invalid values
author IBBoard <dev@ibboard.co.uk>
date Fri, 13 Nov 2009 10:29:20 +0000
parents e8e9026dd4ea
children e586ea79c102
files IBBoard.WarFoundry.API.csproj api/Util/UnitEquipmentUtil.cs
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/IBBoard.WarFoundry.API.csproj	Mon Nov 09 16:49:27 2009 +0000
+++ b/IBBoard.WarFoundry.API.csproj	Fri Nov 13 10:29:20 2009 +0000
@@ -42,6 +42,8 @@
     </None>
     <None Include="dtds\race.xsd">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <SubType>
+      </SubType>
     </None>
     <None Include="dtds\warfoundry-core.xsd">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
--- a/api/Util/UnitEquipmentUtil.cs	Mon Nov 09 16:49:27 2009 +0000
+++ b/api/Util/UnitEquipmentUtil.cs	Fri Nov 13 10:29:20 2009 +0000
@@ -178,9 +178,7 @@
 		
 		public static double GetMinEquipmentPercentage(Unit unit, UnitEquipmentItem equip)
 		{
-			double limitMin = GetMinOfSlotLimitAndEquipmentLimit(equip, equip.MinLimit, unit);
-			double countMin = GetPercentageOfUnitSize(GetMinEquipmentCount(unit, equip), unit);
-			return Math.Min(limitMin, countMin);
+			return GetMinOfSlotLimitAndEquipmentLimit(equip, equip.MinLimit, unit);
 		}
 	}
 }