fix #960 -- HackyAI shouldn't put itself in low power so much.

This commit is contained in:
Chris Forbes
2011-08-15 14:23:54 +12:00
parent cc716ab8c7
commit 1aa80e0377
2 changed files with 6 additions and 3 deletions

View File

@@ -145,7 +145,8 @@ namespace OpenRA.Mods.RA
foreach (var frac in Info.BuildingFractions)
if (buildableThings.Any(b => b.Name == frac.Key))
if (myBuildings.Count(a => a == frac.Key) < frac.Value * myBuildings.Length)
if (myBuildings.Count(a => a == frac.Key) < frac.Value * myBuildings.Length &&
playerPower.ExcessPower >= Rules.Info[frac.Key].Traits.Get<BuildingInfo>().Power)
return Rules.Info[frac.Key];
return null;