fix units being visible under fog
This commit is contained in:
@@ -30,17 +30,13 @@ namespace OpenRA.Traits
|
||||
public override object Create(Actor self) { return new RenderUnit(self); }
|
||||
}
|
||||
|
||||
class RenderUnit : RenderSimple, INotifyDamage, IRenderModifier
|
||||
class RenderUnit : RenderSimple, INotifyDamage
|
||||
{
|
||||
Shroud shroud;
|
||||
|
||||
public RenderUnit(Actor self)
|
||||
: base(self, () => self.traits.Get<Unit>().Facing)
|
||||
{
|
||||
anim.Play("idle");
|
||||
anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) );
|
||||
|
||||
shroud = self.World.WorldActor.traits.Get<Shroud>();
|
||||
}
|
||||
|
||||
public void PlayCustomAnimation(Actor self, string newAnim, Action after)
|
||||
@@ -62,14 +58,5 @@ namespace OpenRA.Traits
|
||||
() => smoke.PlayBackwardsThen( "end",
|
||||
() => isSmoking = false ) ) );
|
||||
}
|
||||
|
||||
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
||||
{
|
||||
if (self.Owner == self.World.LocalPlayer ||
|
||||
shroud.visibleCells[self.Location.X, self.Location.Y] > 0)
|
||||
return r;
|
||||
|
||||
return new Renderable[] { };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user