Radar takes into account visibility under fog

This commit is contained in:
Paul Chote
2010-07-22 20:26:19 +12:00
parent f7212ef757
commit a09a6997b4
6 changed files with 28 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Traits
public object Create(ActorInitializer init) { return new HiddenUnderFog(init.self); }
}
class HiddenUnderFog : IRenderModifier
class HiddenUnderFog : IRenderModifier, IRadarVisibilityModifier
{
Shroud shroud;
@@ -33,6 +33,11 @@ namespace OpenRA.Traits
|| self.World.LocalPlayer.Shroud.Disabled
|| shroud.visibleCells[self.Location.X, self.Location.Y] > 0;
}
public bool VisibleOnRadar(Actor self)
{
return IsVisible(self);
}
static Renderable[] Nothing = { };
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)