don't stack flashes and filter non unit actor related orders

This commit is contained in:
Matthias Mailänder
2013-11-02 18:26:45 +01:00
parent e0e3f1155a
commit 6b0238a6cc
2 changed files with 8 additions and 2 deletions

View File

@@ -145,9 +145,15 @@ namespace OpenRA.Widgets
foreach (var o in orders) foreach (var o in orders)
{ {
if (o.TargetActor != null) if (o.TargetActor != null)
{
world.Add(new FlashTarget(o.TargetActor)); world.Add(new FlashTarget(o.TargetActor));
else if (o.TargetLocation != CPos.Zero) break;
}
else if (o.Subject != world.LocalPlayer.PlayerActor && o.TargetLocation != CPos.Zero)
{
world.Add(new MoveFlash(worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(mi.Location)), world)); world.Add(new MoveFlash(worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(mi.Location)), world));
break;
}
} }
} }

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
// Find the queue with the target actor // Find the queue with the target actor
var queue = w.ActorsWithTrait<ProductionQueue>() var queue = w.ActorsWithTrait<ProductionQueue>()
.Where(p => p.Actor.Owner == self.Owner && .Where(p => p.Actor.Owner == self.Owner &&
p.Trait.CurrentItem() != null && p.Trait.CurrentItem() != null &&
p.Trait.CurrentItem().Item == order.TargetString && p.Trait.CurrentItem().Item == order.TargetString &&
p.Trait.CurrentItem().RemainingTime == 0) p.Trait.CurrentItem().RemainingTime == 0)
.Select(p => p.Trait) .Select(p => p.Trait)