Fix #3354: Guard queries trait from destroyed object

This commit is contained in:
ScottNZ
2013-05-31 18:10:56 +12:00
parent 6e5d58379f
commit 5f3563d83e

View File

@@ -150,7 +150,7 @@ namespace OpenRA.Mods.RA.Widgets
bool PerformGuard()
{
var actors = World.Selection.Actors.Where(a => a.Owner == World.LocalPlayer && a.HasTrait<Guard>());
var actors = World.Selection.Actors.Where(a => !a.Destroyed && a.Owner == World.LocalPlayer && a.HasTrait<Guard>());
if (actors.Any())
World.OrderGenerator = new GuardOrderGenerator(actors);