Add Map.DistanceAboveTerrain(WPos) and Actor.IsAtGroundLevel() extension method
This commit is contained in:
@@ -65,7 +65,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var cp = self.CenterPosition;
|
||||
if ((cp.Z > 0 && !info.EjectInAir) || (cp.Z == 0 && !info.EjectOnGround))
|
||||
var inAir = !self.IsAtGroundLevel();
|
||||
if ((inAir && !info.EjectInAir) || (!inAir && !info.EjectOnGround))
|
||||
return;
|
||||
|
||||
var pilot = self.World.CreateActor(false, info.PilotActor.ToLowerInvariant(),
|
||||
@@ -73,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (info.AllowUnsuitableCell || IsSuitableCell(self, pilot))
|
||||
{
|
||||
if (cp.Z > 0)
|
||||
if (inAir)
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user