Merge pull request #3454 from pchote/cargo-antivis

Fix shroud glitches once and for all
This commit is contained in:
Matthias Mailänder
2013-06-22 01:01:29 -07:00
6 changed files with 148 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;
}