Only render units our race can build. That FACT prerequisite was unnecessary.
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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()
|
||||
|
||||
1
ra.yaml
1
ra.yaml
@@ -1172,7 +1172,6 @@ POWR:
|
||||
Buildable:
|
||||
TechLevel: 1
|
||||
Tab: Building
|
||||
Prerequisites: fact
|
||||
Owner: allies,soviet
|
||||
Cost: 300
|
||||
Description: Power Plant
|
||||
|
||||
Reference in New Issue
Block a user