Prevents satellite icons from being drawn over frozen actors.

This commit is contained in:
deniz1a
2015-05-16 15:14:38 +03:00
parent ed4b3f9970
commit 106286da23
3 changed files with 10 additions and 7 deletions

View File

@@ -38,8 +38,8 @@ namespace OpenRA.Traits
public int HP; public int HP;
public DamageState DamageState; public DamageState DamageState;
public bool Visible; public bool Visible = true;
public bool NeedRenderables;
public bool IsRendering { get; private set; } public bool IsRendering { get; private set; }
public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud) public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud)
@@ -63,7 +63,6 @@ namespace OpenRA.Traits
int flashTicks; int flashTicks;
IRenderable[] renderables = NoRenderables; IRenderable[] renderables = NoRenderables;
bool needRenderables;
public void Tick() public void Tick()
{ {
@@ -88,7 +87,7 @@ namespace OpenRA.Traits
} }
if (Visible && !wasVisible) if (Visible && !wasVisible)
needRenderables = true; NeedRenderables = true;
} }
public void Flash() public void Flash()
@@ -98,9 +97,9 @@ namespace OpenRA.Traits
public IEnumerable<IRenderable> Render(WorldRenderer wr) public IEnumerable<IRenderable> Render(WorldRenderer wr)
{ {
if (needRenderables) if (NeedRenderables)
{ {
needRenderables = false; NeedRenderables = false;
if (!actor.Destroyed) if (!actor.Destroyed)
{ {
IsRendering = true; IsRendering = true;

View File

@@ -72,6 +72,7 @@ namespace OpenRA.Mods.Common.Traits
if (!initialized) if (!initialized)
{ {
frozen[player] = frozenActor = new FrozenActor(self, footprint, footprintRegion, player.Shroud); frozen[player] = frozenActor = new FrozenActor(self, footprint, footprintRegion, player.Shroud);
frozen[player].NeedRenderables = frozenActor.NeedRenderables = startsRevealed;
player.PlayerActor.Trait<FrozenActorLayer>().Add(frozenActor); player.PlayerActor.Trait<FrozenActorLayer>().Add(frozenActor);
isVisible = visible[player] |= startsRevealed; isVisible = visible[player] |= startsRevealed;
} }

View File

@@ -81,7 +81,10 @@ namespace OpenRA.Mods.RA.Effects
if (f == null) if (f == null)
return false; return false;
return f.Visible && !f.HasRenderables; if (f.HasRenderables || f.NeedRenderables)
return false;
return f.Visible;
} }
public void Tick(World world) public void Tick(World world)