From 7c2baa75bbd3423ed4cff1af33bc4399f49d2844 Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 12 Jan 2010 23:34:05 +1300 Subject: [PATCH] fixed crashbug wrt FACT not being Buildable --- OpenRa.Game/GameRules/TechTree.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OpenRa.Game/GameRules/TechTree.cs b/OpenRa.Game/GameRules/TechTree.cs index 706fb7f953..80bb04b47b 100755 --- a/OpenRa.Game/GameRules/TechTree.cs +++ b/OpenRa.Game/GameRules/TechTree.cs @@ -38,9 +38,8 @@ namespace OpenRa.Game.GameRules return false; foreach( var p in bi.Prerequisites ) - if (Rules.NewUnitInfo[p.ToLowerInvariant()].Traits.Get().Owner.Any(x => x == player.Race)) - if( playerBuildings[ p ].Count == 0 ) - return false; + if( playerBuildings[ p ].Count == 0 ) + return false; if( producesIndex[ Rules.UnitCategory[ info.Name ] ].All( x => playerBuildings[ x.Name ].Count == 0 ) ) return false; @@ -58,8 +57,7 @@ namespace OpenRa.Game.GameRules public IEnumerable AllItems(Player player, params string[] categories) { - return categories.SelectMany(x => Rules.Categories[x]).Select(x => Rules.NewUnitInfo[x].Name) - .Where(x => Rules.NewUnitInfo[x].Traits.Get().Owner.Contains(player.Race)); /* todo: fix for dual-race scenarios (captured buildings) */ + return categories.SelectMany(x => Rules.Categories[x]).Select(x => Rules.NewUnitInfo[x].Name); } public IEnumerable UnitBuiltAt( NewUnitInfo info )