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)
|
var allItems = Rules.TechTree.AllItems(Game.LocalPlayer, queueName)
|
||||||
.Where(a => Rules.NewUnitInfo[a].Traits.Contains<BuildableInfo>())
|
.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);
|
.OrderBy(a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().TechLevel);
|
||||||
|
|
||||||
var queue = Game.LocalPlayer.PlayerActor.traits.Get<Traits.ProductionQueue>();
|
var queue = Game.LocalPlayer.PlayerActor.traits.Get<Traits.ProductionQueue>();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace OpenRa.Game.GameRules
|
|||||||
var bi = info.Traits.GetOrDefault<BuildableInfo>();
|
var bi = info.Traits.GetOrDefault<BuildableInfo>();
|
||||||
if( bi == null ) return false;
|
if( bi == null ) return false;
|
||||||
|
|
||||||
if( !bi.Owner.Any( x => x == player.Race ) )
|
if( !bi.Owner.Contains( player.Race ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach( var p in bi.Prerequisites )
|
foreach( var p in bi.Prerequisites )
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ namespace OpenRa.Game
|
|||||||
var buildings = Rules.TechTree.GatherBuildings(Owner);
|
var buildings = Rules.TechTree.GatherBuildings(Owner);
|
||||||
var effectivePrereq = Info.Prerequisite
|
var effectivePrereq = Info.Prerequisite
|
||||||
.Select( a => a.ToLowerInvariant() )
|
.Select( a => a.ToLowerInvariant() )
|
||||||
.Where( a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().Owner
|
.Where( a => Rules.NewUnitInfo[a].Traits.Get<BuildableInfo>().Owner.Contains( Owner.Race ));
|
||||||
.Any( r => r == Owner.Race ));
|
|
||||||
|
|
||||||
IsAvailable = Info.TechLevel > -1
|
IsAvailable = Info.TechLevel > -1
|
||||||
&& effectivePrereq.Any()
|
&& effectivePrereq.Any()
|
||||||
|
|||||||
1
ra.yaml
1
ra.yaml
@@ -1172,7 +1172,6 @@ POWR:
|
|||||||
Buildable:
|
Buildable:
|
||||||
TechLevel: 1
|
TechLevel: 1
|
||||||
Tab: Building
|
Tab: Building
|
||||||
Prerequisites: fact
|
|
||||||
Owner: allies,soviet
|
Owner: allies,soviet
|
||||||
Cost: 300
|
Cost: 300
|
||||||
Description: Power Plant
|
Description: Power Plant
|
||||||
|
|||||||
Reference in New Issue
Block a user