fixed crashbug wrt FACT not being Buildable
This commit is contained in:
@@ -38,9 +38,8 @@ namespace OpenRa.Game.GameRules
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach( var p in bi.Prerequisites )
|
foreach( var p in bi.Prerequisites )
|
||||||
if (Rules.NewUnitInfo[p.ToLowerInvariant()].Traits.Get<BuildableInfo>().Owner.Any(x => x == player.Race))
|
if( playerBuildings[ p ].Count == 0 )
|
||||||
if( playerBuildings[ p ].Count == 0 )
|
return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
if( producesIndex[ Rules.UnitCategory[ info.Name ] ].All( x => playerBuildings[ x.Name ].Count == 0 ) )
|
if( producesIndex[ Rules.UnitCategory[ info.Name ] ].All( x => playerBuildings[ x.Name ].Count == 0 ) )
|
||||||
return false;
|
return false;
|
||||||
@@ -58,8 +57,7 @@ namespace OpenRa.Game.GameRules
|
|||||||
|
|
||||||
public IEnumerable<string> AllItems(Player player, params string[] categories)
|
public IEnumerable<string> AllItems(Player player, params string[] categories)
|
||||||
{
|
{
|
||||||
return categories.SelectMany(x => Rules.Categories[x]).Select(x => Rules.NewUnitInfo[x].Name)
|
return categories.SelectMany(x => Rules.Categories[x]).Select(x => Rules.NewUnitInfo[x].Name);
|
||||||
.Where(x => Rules.NewUnitInfo[x].Traits.Get<BuildableInfo>().Owner.Contains(player.Race)); /* todo: fix for dual-race scenarios (captured buildings) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<NewUnitInfo> UnitBuiltAt( NewUnitInfo info )
|
public IEnumerable<NewUnitInfo> UnitBuiltAt( NewUnitInfo info )
|
||||||
|
|||||||
Reference in New Issue
Block a user