#117 off-map planes should spawn at cruise altitude
This commit is contained in:
@@ -24,7 +24,7 @@ using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
class PlaneInfo : ITraitInfo
|
||||
public class PlaneInfo : ITraitInfo
|
||||
{
|
||||
public readonly int CruiseAltitude = 20;
|
||||
public readonly string[] RearmBuildings = { "afld" };
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Traits
|
||||
public object Create(Actor self) { return new Plane(self); }
|
||||
}
|
||||
|
||||
class Plane : IIssueOrder, IResolveOrder, IMovement
|
||||
public class Plane : IIssueOrder, IResolveOrder, IMovement
|
||||
{
|
||||
public IDisposable reservation;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace OpenRA.Mods.Cnc
|
||||
var a = w.CreateActor("C17", startPos, owner);
|
||||
var cargo = a.traits.Get<Cargo>();
|
||||
a.traits.Get<Unit>().Facing = 64;
|
||||
a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
|
||||
var newUnit = new Actor(self.World, producee.Name, new int2(0, 0), self.Owner);
|
||||
cargo.Load(a, newUnit);
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
var a = w.CreateActor("BADR", startPos, owner);
|
||||
a.traits.Get<Unit>().Facing = Util.GetFacing(p - startPos, 0);
|
||||
a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
|
||||
a.CancelActivity();
|
||||
a.QueueActivity(new FlyCircle(p));
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace OpenRA.Mods.RA
|
||||
var enterCell = self.World.ChooseRandomEdgeCell();
|
||||
|
||||
var plane = self.World.CreateActor("U2", enterCell, self.Owner);
|
||||
plane.traits.Get<Unit>().Altitude = plane.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
plane.traits.Get<Unit>().Facing = Util.GetFacing(order.TargetLocation - enterCell, 0);
|
||||
|
||||
plane.CancelActivity();
|
||||
|
||||
Reference in New Issue
Block a user