Fixes AI units hunting down Missile Silo/Temple of Nod after being damaged by nuke

This commit is contained in:
reaperrr
2014-05-16 17:30:01 +02:00
parent bad6a99caf
commit bbf2364bba
2 changed files with 4 additions and 4 deletions

View File

@@ -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<ScreenShaker>().AddEffect(20, pos, 5);
foreach (var a in world.ActorsWithTrait<NukePaletteEffect>())

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA
var rb = self.Trait<RenderSimple>();
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)));