Convert NukeLaunch to world coordinates.

This commit is contained in:
Paul Chote
2013-04-04 20:22:31 +13:00
parent 4b4c1b71df
commit 170e14546a
4 changed files with 18 additions and 23 deletions

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA
{
[WeaponReference]
public readonly string MissileWeapon = "";
public readonly int2 SpawnOffset = int2.Zero;
public readonly WVec SpawnOffset = WVec.Zero;
public override object Create(ActorInitializer init) { return new NukePower(init.self, this); }
}
@@ -39,10 +39,10 @@ namespace OpenRA.Mods.RA
Sound.Play(Info.LaunchSound);
var npi = Info as NukePowerInfo;
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
var rb = self.Trait<RenderSimple>();
rb.PlayCustomAnim(self, "active");
self.World.AddFrameEndTask(w => w.Add(
new NukeLaunch(self.Owner, self, npi.MissileWeapon, (PVecInt)npi.SpawnOffset, order.TargetLocation)));
new NukeLaunch(self.Owner, self, npi.MissileWeapon, self.CenterPosition + rb.LocalToWorld(npi.SpawnOffset), order.TargetLocation)));
}
}
}