changeset 464:59e1fb8a476a

Re #394: Make requirements (or factory) more closely match Rollcall methods * Fix ratio check - we were doing an unnecessary division
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Mar 2012 16:40:01 +0000
parents cbeee87dc2d3
children 7b9ff7b1df24
files API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs	Sat Mar 17 20:02:32 2012 +0000
     1.2 +++ b/API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs	Sat Mar 24 16:40:01 2012 +0000
     1.3 @@ -71,9 +71,8 @@
     1.4  
     1.5  		private bool IsValidByRequirement(UnitCountRequirementData limit, int allowedTypeCount, int limitedTypeCount)
     1.6  		{
     1.7 -			int wholeNumLimited = (limitedTypeCount / limit.Count);
     1.8  			double allowedRatio = (limit.AllowsCount / (limit.Count * 1.0));
     1.9 -			return allowedRatio * wholeNumLimited >= allowedTypeCount;
    1.10 +			return allowedRatio * limitedTypeCount >= allowedTypeCount;
    1.11  		}
    1.12  
    1.13  		public override Validation AllowsAdding(IWarFoundryObject wfObject, Army toArmy)