Add GroundPosition VisibilityType.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
var ios = actorInfo.Value.TraitInfoOrDefault<IOccupySpaceInfo>();
|
var ios = actorInfo.Value.TraitInfoOrDefault<IOccupySpaceInfo>();
|
||||||
foreach (var rsi in actorInfo.Value.TraitInfos<RevealsShroudInfo>())
|
foreach (var rsi in actorInfo.Value.TraitInfos<RevealsShroudInfo>())
|
||||||
{
|
{
|
||||||
if (rsi.Type == VisibilityType.CenterPosition)
|
if (rsi.Type != VisibilityType.Footprint)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ios == null)
|
if (ios == null)
|
||||||
|
|||||||
@@ -53,7 +53,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
.SelectMany(kv => Shroud.ProjectedCellsInRange(map, kv.First, range, Info.MaxHeightDelta))
|
.SelectMany(kv => Shroud.ProjectedCellsInRange(map, kv.First, range, Info.MaxHeightDelta))
|
||||||
.Distinct().ToArray();
|
.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();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.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.")]
|
[Desc("The actor stays invisible under the shroud.")]
|
||||||
public class HiddenUnderShroudInfo : ITraitInfo, IDefaultVisibilityInfo
|
public class HiddenUnderShroudInfo : ITraitInfo, IDefaultVisibilityInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user