From f6a52f4e5061e1b857197c97d10b862d7e0296d0 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 27 Mar 2010 18:07:01 +1300 Subject: [PATCH] #117 off-map planes should spawn at cruise altitude --- OpenRA.Game/Traits/Plane.cs | 4 ++-- OpenRA.Mods.Cnc/ProductionAirdrop.cs | 1 + OpenRA.Mods.RA/ParatroopersPower.cs | 1 + OpenRA.Mods.RA/SpyPlanePower.cs | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/Plane.cs b/OpenRA.Game/Traits/Plane.cs index 928d20c862..816d38f19a 100644 --- a/OpenRA.Game/Traits/Plane.cs +++ b/OpenRA.Game/Traits/Plane.cs @@ -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; diff --git a/OpenRA.Mods.Cnc/ProductionAirdrop.cs b/OpenRA.Mods.Cnc/ProductionAirdrop.cs index af03f7287b..ff5c0c665b 100644 --- a/OpenRA.Mods.Cnc/ProductionAirdrop.cs +++ b/OpenRA.Mods.Cnc/ProductionAirdrop.cs @@ -49,6 +49,7 @@ namespace OpenRA.Mods.Cnc var a = w.CreateActor("C17", startPos, owner); var cargo = a.traits.Get(); a.traits.Get().Facing = 64; + a.traits.Get().Altitude = a.Info.Traits.Get().CruiseAltitude; var newUnit = new Actor(self.World, producee.Name, new int2(0, 0), self.Owner); cargo.Load(a, newUnit); diff --git a/OpenRA.Mods.RA/ParatroopersPower.cs b/OpenRA.Mods.RA/ParatroopersPower.cs index ee11105813..b6b4ee9309 100644 --- a/OpenRA.Mods.RA/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/ParatroopersPower.cs @@ -78,6 +78,7 @@ namespace OpenRA.Mods.RA { var a = w.CreateActor("BADR", startPos, owner); a.traits.Get().Facing = Util.GetFacing(p - startPos, 0); + a.traits.Get().Altitude = a.Info.Traits.Get().CruiseAltitude; a.CancelActivity(); a.QueueActivity(new FlyCircle(p)); diff --git a/OpenRA.Mods.RA/SpyPlanePower.cs b/OpenRA.Mods.RA/SpyPlanePower.cs index cf457f7c4f..92cf2aa65f 100644 --- a/OpenRA.Mods.RA/SpyPlanePower.cs +++ b/OpenRA.Mods.RA/SpyPlanePower.cs @@ -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().Altitude = plane.Info.Traits.Get().CruiseAltitude; plane.traits.Get().Facing = Util.GetFacing(order.TargetLocation - enterCell, 0); plane.CancelActivity();