diff --git a/OpenRA.Mods.RA/Effects/Parachute.cs b/OpenRA.Mods.RA/Effects/Parachute.cs index f05adcc035..1767e334a7 100644 --- a/OpenRA.Mods.RA/Effects/Parachute.cs +++ b/OpenRA.Mods.RA/Effects/Parachute.cs @@ -28,12 +28,13 @@ namespace OpenRA.Mods.RA.Effects { this.cargo = cargo; - var pai = cargo.Info.Traits.GetOrDefault(); - paraAnim = new Animation(cargo.World, pai != null ? pai.ParachuteSprite : "parach"); + var parachutableInfo = cargo.Info.Traits.GetOrDefault(); + var sprite = parachutableInfo != null ? parachutableInfo.ParachuteSprite : "parach"; + paraAnim = new Animation(cargo.World, sprite); paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle")); - if (pai != null) - parachuteOffset = pai.Offset; + if (parachutableInfo != null) + parachuteOffset = parachutableInfo.ParachuteOffset; // Adjust x,y to match the target subcell cargo.Trait().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition)); diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 6222220704..60f4dac608 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -279,7 +279,6 @@ - diff --git a/OpenRA.Mods.RA/Parachutable.cs b/OpenRA.Mods.RA/Parachutable.cs index 0f29cc98df..75e2586b67 100644 --- a/OpenRA.Mods.RA/Parachutable.cs +++ b/OpenRA.Mods.RA/Parachutable.cs @@ -26,6 +26,9 @@ namespace OpenRA.Mods.RA public readonly string WaterCorpseSequence = "small_splash"; public readonly string WaterCorpsePalette = "effect"; + public readonly string ParachuteSprite = "parach"; + public readonly WVec ParachuteOffset = WVec.Zero; + public object Create(ActorInitializer init) { return new Parachutable(init, this); } } diff --git a/OpenRA.Mods.RA/ParachuteAttachment.cs b/OpenRA.Mods.RA/ParachuteAttachment.cs deleted file mode 100644 index f6850ebc9e..0000000000 --- a/OpenRA.Mods.RA/ParachuteAttachment.cs +++ /dev/null @@ -1,22 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using OpenRA.Traits; - -namespace OpenRA.Mods.RA -{ - class ParachuteAttachmentInfo : TraitInfo - { - public readonly string ParachuteSprite = "parach"; - public readonly WVec Offset = WVec.Zero; - } - - class ParachuteAttachment {} -} \ No newline at end of file diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index 5d707c7f00..80c7df9c69 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -252,6 +252,19 @@ namespace OpenRA.Utility node.Key = "StoresResources"; } + // ParachuteAttachment was merged into Parachutable + if (engineVersion < 20140701) + { + if (depth == 1 && node.Key == "ParachuteAttachment") + { + node.Key = "Parachutable"; + + foreach (var subnode in node.Value.Nodes) + if (subnode.Key == "Offset") + subnode.Key = "ParachuteOffset"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index ba43db8d03..ea847021f2 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -151,8 +151,6 @@ GivesBounty: GpsDot: String: Infantry - ParachuteAttachment: - Offset: 0,0,427 CrushableInfantry: CrushSound: squishy2.aud UpdatesPlayerStatistics: @@ -178,6 +176,7 @@ DeathSound: Zapped InfDeaths: 6 Parachutable: + ParachuteOffset: 0,0,427 ^Ship: AppearsOnRadar: