Navigation Menu

Skip to content

Commit

Permalink
Another dead actor crashfix
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Sep 3, 2010
1 parent 5a78df0 commit 112fdb3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OpenRA.Mods.RA/World/ChooseBuildTabOnSelect.cs
Expand Up @@ -32,7 +32,7 @@ public void SelectionChanged()
{
// Queue-per-structure
var perqueue = world.Selection.Actors.FirstOrDefault(
a => a.World.LocalPlayer == a.Owner && a.HasTrait<ProductionQueue>());
a => a.IsInWorld && a.World.LocalPlayer == a.Owner && a.HasTrait<ProductionQueue>());

if (perqueue != null)
{
Expand All @@ -42,7 +42,8 @@ public void SelectionChanged()
}

// Queue-per-player
var types = world.Selection.Actors.SelectMany(a => a.TraitsImplementing<Production>())
var types = world.Selection.Actors.Where(a => a.IsInWorld)
.SelectMany(a => a.TraitsImplementing<Production>())
.SelectMany(t => t.Info.Produces)
.Distinct();

Expand Down

0 comments on commit 112fdb3

Please sign in to comment.