Add GroundPosition VisibilityType.

This commit is contained in:
Paul Chote
2016-11-26 21:10:41 +00:00
parent ef8a7a535d
commit b1f99dd601
3 changed files with 7 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Lint
var ios = actorInfo.Value.TraitInfoOrDefault<IOccupySpaceInfo>();
foreach (var rsi in actorInfo.Value.TraitInfos<RevealsShroudInfo>())
{
if (rsi.Type == VisibilityType.CenterPosition)
if (rsi.Type != VisibilityType.Footprint)
continue;
if (ios == null)

View File

@@ -53,7 +53,11 @@ namespace OpenRA.Mods.Common.Traits
.SelectMany(kv => Shroud.ProjectedCellsInRange(map, kv.First, range, Info.MaxHeightDelta))
.Distinct().ToArray();
return Shroud.ProjectedCellsInRange(map, self.CenterPosition, range, Info.MaxHeightDelta)
var pos = self.CenterPosition;
if (Info.Type == VisibilityType.GroundPosition)
pos -= new WVec(WDist.Zero, WDist.Zero, self.World.Map.DistanceAboveTerrain(pos));
return Shroud.ProjectedCellsInRange(map, pos, range, Info.MaxHeightDelta)
.ToArray();
}

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public enum VisibilityType { Footprint, CenterPosition }
public enum VisibilityType { Footprint, CenterPosition, GroundPosition }
[Desc("The actor stays invisible under the shroud.")]
public class HiddenUnderShroudInfo : ITraitInfo, IDefaultVisibilityInfo