Mercurial > repos > snowblizz-super-API-ideas
changeset 210:e586ea79c102
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 11:24:27 +0000 |
parents | 1cde49671c8b |
children | 1f39e325deee |
files | api/Util/UnitEquipmentUtil.cs |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/api/Util/UnitEquipmentUtil.cs Fri Nov 13 10:29:20 2009 +0000 +++ b/api/Util/UnitEquipmentUtil.cs Fri Nov 13 11:24:27 2009 +0000 @@ -139,9 +139,7 @@ public static double GetMaxEquipmentPercentage(Unit unit, UnitEquipmentItem equip) { - double limitMax = GetMinOfSlotLimitAndEquipmentLimit(equip, equip.MaxLimit, unit); - double countMax = GetPercentageOfUnitSize(GetMaxEquipmentCount(unit, equip), unit); - return Math.Max(limitMax, countMax); + return GetMinOfSlotLimitAndEquipmentLimit(equip, equip.MaxLimit, unit); } private static double GetPercentageOfUnitSize(int number, Unit unit)