changeset 94:49a83020174e

Re #116: Percentage limits on equipment items are negative * Correctly handle "equip all" for rendering of percentages
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Aug 2009 20:06:21 +0000
parents 789dfab13449
children 6c6cfe5594fc
files api/Objects/UnitEquipmentItem.cs
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/api/Objects/UnitEquipmentItem.cs	Fri Aug 07 20:14:55 2009 +0000
+++ b/api/Objects/UnitEquipmentItem.cs	Sat Aug 08 20:06:21 2009 +0000
@@ -220,21 +220,18 @@
 		}
 		
 		public static string FormatEquipmentAmount(UnitEquipmentItem item, double amount)
-		{
-			if (item.IsRatioLimit)
+		{
+			if (amount == WarFoundryCore.INFINITY)
+			{
+				return "all"; //TODO: Translate
+			}
+			else if (item.IsRatioLimit)
 			{
 				return Math.Round(amount * 100) + "%";
 			}
 			else
 			{
-				if (amount == WarFoundryCore.INFINITY)
-				{
-					return "all"; //TODO: Translate
-				}
-				else
-				{
-					return amount.ToString();
-				}
+				return amount.ToString();
 			}
 		}
 	}