Remove Order.TargetLocation from support powers.
This commit is contained in:
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
base.Activate(self, order, manager);
|
||||
|
||||
SendAirstrike(self, self.World.Map.CenterOfCell(order.TargetLocation));
|
||||
SendAirstrike(self, order.Target.CenterPosition);
|
||||
}
|
||||
|
||||
public void SendAirstrike(Actor self, WPos target, bool randomize = true, int attackFacing = 0)
|
||||
|
||||
@@ -71,9 +71,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (wsb != null && wsb.DefaultAnimation.HasSequence(info.Sequence))
|
||||
wsb.PlayCustomAnimation(self, info.Sequence);
|
||||
|
||||
Game.Sound.Play(SoundType.World, info.OnFireSound, self.World.Map.CenterOfCell(order.TargetLocation));
|
||||
Game.Sound.Play(SoundType.World, info.OnFireSound, order.Target.CenterPosition);
|
||||
|
||||
foreach (var a in UnitsInRange(order.TargetLocation))
|
||||
foreach (var a in UnitsInRange(self.World.Map.CellContaining(order.Target.CenterPosition)))
|
||||
{
|
||||
var external = a.TraitsImplementing<ExternalCondition>()
|
||||
.FirstOrDefault(t => t.Info.Condition == info.Condition && t.CanGrantCondition(a, self));
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
base.Activate(self, order, manager);
|
||||
PlayLaunchSounds();
|
||||
|
||||
Activate(self, self.World.Map.CenterOfCell(order.TargetLocation));
|
||||
Activate(self, order.Target.CenterPosition);
|
||||
}
|
||||
|
||||
public void Activate(Actor self, WPos targetPosition)
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
base.Activate(self, order, manager);
|
||||
|
||||
SendParatroopers(self, self.World.Map.CenterOfCell(order.TargetLocation));
|
||||
SendParatroopers(self, order.Target.CenterPosition);
|
||||
}
|
||||
|
||||
public Actor[] SendParatroopers(Actor self, WPos target, bool randomize = true, int dropFacing = 0)
|
||||
|
||||
@@ -48,17 +48,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var location = self.World.Map.CenterOfCell(order.TargetLocation);
|
||||
|
||||
PlayLaunchSounds();
|
||||
Game.Sound.Play(SoundType.World, info.DeploySound, location);
|
||||
Game.Sound.Play(SoundType.World, info.DeploySound, order.Target.CenterPosition);
|
||||
|
||||
if (!string.IsNullOrEmpty(info.EffectSequence) && !string.IsNullOrEmpty(info.EffectPalette))
|
||||
w.Add(new SpriteEffect(location, w, info.EffectImage, info.EffectSequence, info.EffectPalette));
|
||||
w.Add(new SpriteEffect(order.Target.CenterPosition, w, info.EffectImage, info.EffectSequence, info.EffectPalette));
|
||||
|
||||
var actor = w.CreateActor(info.Actor, new TypeDictionary
|
||||
{
|
||||
new LocationInit(order.TargetLocation),
|
||||
new LocationInit(self.World.Map.CellContaining(order.Target.CenterPosition)),
|
||||
new OwnerInit(self.Owner),
|
||||
});
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
ping = manager.RadarPings.Value.Add(
|
||||
() => order.Player.IsAlliedWith(self.World.RenderPlayer),
|
||||
self.World.Map.CenterOfCell(order.TargetLocation),
|
||||
order.Target.CenterPosition,
|
||||
order.Player.Color.RGB,
|
||||
Info.RadarPingDuration);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (a.Self.OccupiesSpace == null)
|
||||
return 0;
|
||||
|
||||
return (a.Self.CenterPosition - a.Self.World.Map.CenterOfCell(order.TargetLocation)).HorizontalLengthSquared;
|
||||
return (a.Self.CenterPosition - order.Target.CenterPosition).HorizontalLengthSquared;
|
||||
});
|
||||
|
||||
if (power == null)
|
||||
|
||||
Reference in New Issue
Block a user