Fix FrozenUnderFog; add to cnc.

This commit is contained in:
Paul Chote
2010-11-27 00:53:49 +13:00
parent e91caa4e7a
commit 9655b34e5f
2 changed files with 9 additions and 2 deletions

View File

@@ -16,12 +16,17 @@ namespace OpenRA.Mods.RA
{ {
class FrozenUnderFogInfo : TraitInfo<FrozenUnderFog> {} class FrozenUnderFogInfo : TraitInfo<FrozenUnderFog> {}
class FrozenUnderFog : IRenderModifier class FrozenUnderFog : IRenderModifier, IVisibilityModifier
{ {
public bool IsVisible(Actor self)
{
return Shroud.GetVisOrigins(self).Any(o => self.World.LocalShroud.IsVisible(o));
}
Renderable[] cache = { }; Renderable[] cache = { };
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r) public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
{ {
if (self.World.LocalShroud.IsVisible(self)) if (IsVisible(self))
cache = r.ToArray(); cache = r.ToArray();
return cache; return cache;
} }

View File

@@ -193,6 +193,7 @@
Queue: Building Queue: Building
RenderBuilding: RenderBuilding:
DeadBuildingState: DeadBuildingState:
FrozenUnderFog:
EmitInfantryOnSell: EmitInfantryOnSell:
ActorTypes: c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,e1,e1,e1,e1,e1,e1,e1 ActorTypes: c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,e1,e1,e1,e1,e1,e1,e1
MustBeDestroyed: MustBeDestroyed:
@@ -219,6 +220,7 @@
Type: Wood Type: Wood
Building: Building:
-RepairableBuilding: -RepairableBuilding:
-FrozenUnderFog:
Tooltip: Tooltip:
Name: Civilian Building Name: Civilian Building