Add GroundPosition VisibilityType.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user