changeset 173:e83fc7b493f4

Fixes #195: Setting max equipment without min may not function correctly * Fix infinity ("equip all") issues
author IBBoard <dev@ibboard.co.uk>
date Mon, 12 Oct 2009 19:51:19 +0000
parents f364a9e5463e
children 33433862467f
files api/Objects/UnitEquipmentItem.cs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/api/Objects/UnitEquipmentItem.cs	Mon Oct 12 19:43:45 2009 +0000
+++ b/api/Objects/UnitEquipmentItem.cs	Mon Oct 12 19:51:19 2009 +0000
@@ -144,7 +144,7 @@
 		
 		private void CheckMaxNumber()
 		{
-			if (MaxNumber < MinNumber)
+			if (MaxNumber < MinNumber || MinNumber == WarFoundryCore.INFINITY)
 			{
 				MaxNumber = MinNumber;
 			}
@@ -165,7 +165,7 @@
 		
 		private void CheckMinNumber()
 		{
-			if (MinNumber > MaxNumber || (MinNumber == 0 && MaxNumber != 0))
+			if ((MinNumber > MaxNumber && MaxNumber != WarFoundryCore.INFINITY) || (MinNumber == 0 && MaxNumber != 0))
 			{
 				MinNumber = MaxNumber;
 			}