diff --git a/OpenRA.Mods.RA/Air/EjectOnDeath.cs b/OpenRA.Mods.RA/Air/EjectOnDeath.cs index 1f9812331e..33c9cf421b 100644 --- a/OpenRA.Mods.RA/Air/EjectOnDeath.cs +++ b/OpenRA.Mods.RA/Air/EjectOnDeath.cs @@ -33,9 +33,8 @@ namespace OpenRA.Mods.RA if (IsSuitableCell(pilot, self.Location) && r > 100 - info.SuccessRate && aircraft.Altitude > 10) { - var rs = pilot.Trait(); self.World.AddFrameEndTask(w => w.Add( - new Parachute(pilot.Owner, rs.anim.Name, + new Parachute(pilot.Owner, Util.CenterOfCell(Util.CellContaining(self.CenterLocation)), aircraft.Altitude, pilot))); diff --git a/OpenRA.Mods.RA/Effects/Parachute.cs b/OpenRA.Mods.RA/Effects/Parachute.cs index 283c05aee1..da756c3cdf 100644 --- a/OpenRA.Mods.RA/Effects/Parachute.cs +++ b/OpenRA.Mods.RA/Effects/Parachute.cs @@ -28,13 +28,16 @@ namespace OpenRA.Mods.RA.Effects float altitude; const float fallRate = .3f; - public Parachute(Player owner, string image, float2 location, int altitude, Actor cargo) + public Parachute(Player owner, float2 location, int altitude, Actor cargo) { this.location = location; this.altitude = altitude; this.cargo = cargo; this.owner = owner; + var rs = cargo.Trait(); + var image = rs.anim.Name; + anim = new Animation(image); if (anim.HasSequence("idle")) anim.PlayFetchIndex("idle", () => 0); diff --git a/OpenRA.Mods.RA/ParaDrop.cs b/OpenRA.Mods.RA/ParaDrop.cs index 484ff54a86..ea80ae4753 100644 --- a/OpenRA.Mods.RA/ParaDrop.cs +++ b/OpenRA.Mods.RA/ParaDrop.cs @@ -52,11 +52,10 @@ namespace OpenRA.Mods.RA droppedAt.Add(self.Location); var a = cargo.Unload(self); - var rs = a.Trait(); var aircraft = self.Trait(); self.World.AddFrameEndTask(w => w.Add( - new Parachute(self.Owner, rs.anim.Name, + new Parachute(self.Owner, Util.CenterOfCell(Util.CellContaining(self.CenterLocation)), aircraft.Altitude, a)));