Remove region assumptions from fast shroud tests.
This commit is contained in:
@@ -42,12 +42,16 @@ namespace OpenRA.Traits
|
||||
public bool NeedRenderables;
|
||||
public bool IsRendering { get; private set; }
|
||||
|
||||
public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud)
|
||||
public FrozenActor(Actor self, MPos[] footprint, Shroud shroud)
|
||||
{
|
||||
actor = self;
|
||||
isVisibleTest = shroud.IsVisibleTest(footprintRegion);
|
||||
isVisibleTest = shroud.IsVisibleTest;
|
||||
|
||||
// Consider all cells inside the map area (ignoring the current map bounds)
|
||||
Footprint = footprint
|
||||
.Where(m => shroud.Contains(m))
|
||||
.ToArray();
|
||||
|
||||
Footprint = footprint;
|
||||
CenterPosition = self.CenterPosition;
|
||||
Bounds = self.Bounds;
|
||||
|
||||
@@ -80,11 +84,13 @@ namespace OpenRA.Traits
|
||||
// Visible = !Footprint.Any(isVisibleTest);
|
||||
Visible = true;
|
||||
foreach (var uv in Footprint)
|
||||
{
|
||||
if (isVisibleTest(uv))
|
||||
{
|
||||
Visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Visible && !wasVisible)
|
||||
NeedRenderables = true;
|
||||
|
||||
Reference in New Issue
Block a user