From bbf2364bba76674ed9dce18af529b6054cdf72a5 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 16 May 2014 17:30:01 +0200 Subject: [PATCH] Fixes AI units hunting down Missile Silo/Temple of Nod after being damaged by nuke --- OpenRA.Mods.RA/Effects/NukeLaunch.cs | 6 +++--- OpenRA.Mods.RA/SupportPowers/NukePower.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.RA/Effects/NukeLaunch.cs b/OpenRA.Mods.RA/Effects/NukeLaunch.cs index 645c146732..59b95899ac 100755 --- a/OpenRA.Mods.RA/Effects/NukeLaunch.cs +++ b/OpenRA.Mods.RA/Effects/NukeLaunch.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Effects { public class NukeLaunch : IEffect { - readonly Actor firedBy; + readonly Player firedBy; readonly Animation anim; readonly string weapon; @@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Effects WPos pos; int ticks; - public NukeLaunch(Actor firedBy, string weapon, WPos launchPos, WPos targetPos, WRange velocity, int delay, bool skipAscent) + public NukeLaunch(Player firedBy, string weapon, WPos launchPos, WPos targetPos, WRange velocity, int delay, bool skipAscent) { this.firedBy = firedBy; this.weapon = weapon; @@ -79,7 +79,7 @@ namespace OpenRA.Mods.RA.Effects void Explode(World world) { world.AddFrameEndTask(w => w.Remove(this)); - Combat.DoExplosion(firedBy, weapon, pos); + Combat.DoExplosion(firedBy.PlayerActor, weapon, pos); world.WorldActor.Trait().AddEffect(20, pos, 5); foreach (var a in world.ActorsWithTrait()) diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs index 4bc7c90c87..399fddd4ca 100755 --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA var rb = self.Trait(); rb.PlayCustomAnim(self, "active"); - self.World.AddFrameEndTask(w => w.Add(new NukeLaunch(self, npi.MissileWeapon, + self.World.AddFrameEndTask(w => w.Add(new NukeLaunch(self.Owner, npi.MissileWeapon, self.CenterPosition + body.LocalToWorld(npi.SpawnOffset), order.TargetLocation.CenterPosition, npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent)));