Move Cloak, HiddenUnderFog, FrozenUnderFog into Mods.RA; Simplify a pile of related stuff.

This commit is contained in:
Paul Chote
2010-07-28 21:11:50 +12:00
parent 6854d9853b
commit 8fab45ae39
12 changed files with 38 additions and 52 deletions

View File

@@ -121,12 +121,7 @@ namespace OpenRA
if (!Shroud.GetVisOrigins(a).Any(o => a.World.Map.IsInMap(o) && shroud.exploredCells[o.X, o.Y])) // covered by shroud
return false;
var huf = a.traits.GetOrDefault<HiddenUnderFog>(); // hidden under fog
if (huf != null && !huf.IsVisible(a))
return false;
var cloak = a.traits.GetOrDefault<Cloak>();
if (cloak != null && cloak.Cloaked && a.Owner != a.World.LocalPlayer)
if (a.traits.WithInterface<IVisibilityModifier>().Any(t => !t.IsVisible(a)))
return false;
return true;