Shroud, combine IsVisible and IsExplored into a single function.

This commit is contained in:
Vapre
2021-08-10 23:02:05 +02:00
committed by teinarss
parent cc1f10dd35
commit 6e547469d6
4 changed files with 146 additions and 37 deletions

View File

@@ -155,14 +155,15 @@ namespace OpenRA.Traits
// PERF: Avoid LINQ.
foreach (var puv in Footprint)
{
if (shroud.IsVisible(puv))
var cv = shroud.GetVisibility(puv);
if (cv.HasFlag(Shroud.CellVisibility.Visible))
{
Visible = false;
Shrouded = false;
break;
}
if (Shrouded && shroud.IsExplored(puv))
if (Shrouded && cv.HasFlag(Shroud.CellVisibility.Explored))
Shrouded = false;
}