Fix crash on repair non-buildables (fact,proc). Allow special powers to depend on them too.

This commit is contained in:
Paul Chote
2010-06-17 23:48:00 +12:00
parent 4b124950b9
commit 331706d75e
3 changed files with 4 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ namespace OpenRA.Traits
var buildings = Rules.TechTree.GatherBuildings(Owner);
var effectivePrereq = Info.Prerequisites
.Select(a => a.ToLowerInvariant())
.Where(a => Rules.Info[a].Traits.Get<BuildableInfo>().Owner.Contains(Owner.Country.Race));
.Where(a => Rules.Info[a].Traits.Get<ValuedInfo>().Owner.Contains(Owner.Country.Race));
if (Info.Prerequisites.Count() == 0)
return Owner.PlayerActor.traits.Get<PlayerResources>().GetPowerState() == PowerState.Normal;