Simplify and increase robustness of Shroud et al. Fixes #3440.

This commit is contained in:
Paul Chote
2013-06-21 19:54:25 +12:00
parent 574ab7281b
commit 7bce2017c3
6 changed files with 138 additions and 207 deletions

View File

@@ -20,7 +20,8 @@ namespace OpenRA.Mods.RA
{
public void OnInfiltrate(Actor self, Actor infiltrator)
{
infiltrator.Owner.Shroud.MergeShroud(self.Owner.Shroud);
// Steal and reset the owners exploration
infiltrator.Owner.Shroud.Explore(self.Owner.Shroud);
if (!self.Owner.HasFogVisibility())
self.Owner.Shroud.ResetExploration();
}

View File

@@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA
var total = (double)world.Map.Bounds.Width * world.Map.Bounds.Height;
MapControl = world.Actors
.Where(a => !a.IsDead() && a.IsInWorld && a.Owner == player && a.HasTrait<RevealsShroud>())
.SelectMany(a => world.FindTilesInCircle(a.Location, a.Trait<RevealsShroud>().RevealRange.Clamp(0, 50)))
.SelectMany(a => world.FindTilesInCircle(a.Location, a.Trait<RevealsShroud>().Range.Clamp(0, 50)))
.Distinct()
.Count() / total;
}