Only render units our race can build. That FACT prerequisite was unnecessary.

This commit is contained in:
Bob
2010-01-13 00:20:55 +13:00
parent f1bbbac39d
commit ac9e58cf73
5 changed files with 3 additions and 5 deletions

View File

@@ -532,6 +532,7 @@ namespace OpenRa.Game
var allItems = Rules.TechTree.AllItems(Game.LocalPlayer, queueName)
.Where(a => Rules.NewUnitInfo[a].Traits.Contains<BuildableInfo>())
.Where(a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().Owner.Contains(Game.LocalPlayer.Race))
.OrderBy(a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().TechLevel);
var queue = Game.LocalPlayer.PlayerActor.traits.Get<Traits.ProductionQueue>();

View File

@@ -40,7 +40,7 @@ namespace OpenRa.Game.GameRules
var bi = info.Traits.GetOrDefault<BuildableInfo>();
if( bi == null ) return false;
if( !bi.Owner.Any( x => x == player.Race ) )
if( !bi.Owner.Contains( player.Race ) )
return false;
foreach( var p in bi.Prerequisites )

View File

@@ -50,8 +50,7 @@ namespace OpenRa.Game
var buildings = Rules.TechTree.GatherBuildings(Owner);
var effectivePrereq = Info.Prerequisite
.Select( a => a.ToLowerInvariant() )
.Where( a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().Owner
.Any( r => r == Owner.Race ));
.Where( a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().Owner.Contains( Owner.Race ));
IsAvailable = Info.TechLevel > -1
&& effectivePrereq.Any()

View File

@@ -1172,7 +1172,6 @@ POWR:
Buildable:
TechLevel: 1
Tab: Building
Prerequisites: fact
Owner: allies,soviet
Cost: 300
Description: Power Plant

View File

@@ -1256,7 +1256,6 @@ Crewed=yes
; normal power plant
[POWR]
Prerequisite=fact
Strength=400
Armor=wood
TechLevel=1