diff api/Objects/UnitEquipmentItem.cs @ 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 729d9e54162c
children ced5a18d9f52
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();
 			}
 		}
 	}