some more hax

This commit is contained in:
alzeih
2010-07-22 18:01:32 +12:00
parent 6be4e5c266
commit 1497c31908
3 changed files with 3 additions and 2 deletions

View File

@@ -165,6 +165,7 @@ namespace OpenRA.Traits
public static Target FromActor(Actor a) { return new Target { actor = a, valid = true }; }
public static Target FromPos(float2 p) { return new Target { pos = p, valid = true }; }
public static Target FromCell(int2 c) { return new Target { pos = Util.CenterOfCell(c), valid = true }; }
public static Target FromOrder(Order o) { return o.TargetActor != null ? Target.FromActor(o.TargetActor) : Target.FromPos(o.TargetLocation); }
public static readonly Target None = new Target();

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Effects
public IonCannon(Actor firedBy, World world, int2 location)
{
this.firedBy = firedBy;
target = Target.FromPos(OpenRA.Traits.Util.CenterOfCell(location));
target = Target.FromCell(location);
anim = new Animation("ionsfx");
anim.PlayThen("idle", () => Finish(world));
}

View File

@@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA
if (mi.Button == MouseButton.Left) return null;
if (self == underCursor) return null;
var target = underCursor == null ? Target.FromPos(Util.CenterOfCell(xy)) : Target.FromActor(underCursor);
var target = underCursor == null ? Target.FromCell(xy) : Target.FromActor(underCursor);
var isHeal = self.GetPrimaryWeapon().Warheads.First().Damage < 0;
var forceFire = mi.Modifiers.HasModifier(Modifiers.Ctrl);