From 96477b7c1ae080e9eb500c7d5881983af29a35a0 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 13 Jun 2014 21:07:39 +1200 Subject: [PATCH] =?UTF-8?q?Invalidate=20FrozenActors=20that=20don=E2=80=99?= =?UTF-8?q?t=20have=20any=20sprites.=20Fixes=20#4809.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenRA.Game/Traits/Player/FrozenActorLayer.cs | 4 ++-- OpenRA.Game/Widgets/ViewportControllerWidget.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs index c780f7ccb6..e04ff8483b 100755 --- a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs +++ b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs @@ -47,7 +47,7 @@ namespace OpenRA.Traits } public uint ID { get { return actor.ActorID; } } - public bool IsValid { get { return Owner != null; } } + public bool IsValid { get { return Owner != null && HasRenderables; } } public ActorInfo Info { get { return actor.Info; } } public Actor Actor { get { return !actor.IsDead() ? actor : null; } } @@ -87,7 +87,7 @@ namespace OpenRA.Traits return Renderables; } - public bool HasRenderables { get { return Renderables != null; } } + public bool HasRenderables { get { return Renderables != null && Renderables.Any(); } } public override string ToString() { diff --git a/OpenRA.Game/Widgets/ViewportControllerWidget.cs b/OpenRA.Game/Widgets/ViewportControllerWidget.cs index f1ee4fe5e4..dbd04865da 100644 --- a/OpenRA.Game/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportControllerWidget.cs @@ -116,7 +116,7 @@ namespace OpenRA.Widgets } var frozen = world.ScreenMap.FrozenActorsAt(world.RenderPlayer, worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos)) - .Where(a => a.TooltipName != null) + .Where(a => a.TooltipName != null && a.IsValid) .WithHighestSelectionPriority(); if (frozen != null)