From 3dcb7bc02bd9059c5e5cdbb413b5043d51daff77 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 19 Feb 2016 02:41:24 +0100 Subject: [PATCH 1/2] Fix missiles not moving to CruiseAltitude if launched above it --- OpenRA.Mods.Common/Effects/Missile.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index cf700efdf9..4fbf93da74 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -664,6 +664,11 @@ namespace OpenRA.Mods.Common.Effects // of vertical facing bound by the maximum vertical rate of turn var vDist = new WVec(-diffClfMslHgt - info.CruiseAltitude.Length, -speed, 0); desiredVFacing = (sbyte)vDist.HorizontalLengthSquared != 0 ? vDist.Yaw.Facing : vFacing; + + // If the missile is launched above CruiseAltitude, it has to descend instead of climbing + if (-diffClfMslHgt > info.CruiseAltitude.Length) + desiredVFacing = -desiredVFacing; + desiredVFacing = desiredVFacing.Clamp(-info.VerticalRateOfTurn, info.VerticalRateOfTurn); ChangeSpeed(); @@ -675,6 +680,11 @@ namespace OpenRA.Mods.Common.Effects // of vertical facing bound by the maximum vertical rate of turn var vDist = new WVec(-diffClfMslHgt - info.CruiseAltitude.Length, -speed, 0); desiredVFacing = (sbyte)vDist.HorizontalLengthSquared != 0 ? vDist.Yaw.Facing : vFacing; + + // If the missile is launched above CruiseAltitude, it has to descend instead of climbing + if (-diffClfMslHgt > info.CruiseAltitude.Length) + desiredVFacing = -desiredVFacing; + desiredVFacing = desiredVFacing.Clamp(-info.VerticalRateOfTurn, info.VerticalRateOfTurn); ChangeSpeed(); From 5ad89f90a578b7fecb2cb058aa64b75620ad2701 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 20 Mar 2016 14:02:13 +0100 Subject: [PATCH 2/2] Give RA MiG missiles a higher CruiseAltitude --- mods/ra/weapons/missiles.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ra/weapons/missiles.yaml b/mods/ra/weapons/missiles.yaml index 0b9d7b766a..64cfaa9658 100644 --- a/mods/ra/weapons/missiles.yaml +++ b/mods/ra/weapons/missiles.yaml @@ -14,6 +14,7 @@ Maverick: Inaccuracy: 512 Image: DRAGON HorizontalRateOfTurn: 5 + CruiseAltitude: 2c0 RangeLimit: 60 Warhead@1Dam: SpreadDamage Spread: 128