Expose a parameter for reveal behaviour.
VisibilityType.CenterPosition reveals the actor only if its CenterPosition is inside a cell that is visible. VisibilityType.Footprint reveals the actor if any of its footprint cells are visible (this includes Mobile actors moving between two cells).
This commit is contained in:
@@ -28,10 +28,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
protected override bool IsVisibleInner(Actor self, Player byPlayer)
|
||||
{
|
||||
if (!VisibilityFootprint(self).Any(byPlayer.Shroud.IsVisible))
|
||||
return false;
|
||||
if (Info.Type == VisibilityType.Footprint)
|
||||
return self.OccupiesSpace.OccupiedCells()
|
||||
.Any(o => byPlayer.Shroud.IsVisible(o.First));
|
||||
|
||||
return base.IsVisibleInner(self, byPlayer);
|
||||
return byPlayer.Shroud.IsVisible(self.CenterPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user