Remove Mobile assumptions from Lua APIs.

This commit is contained in:
Paul Chote
2014-10-04 13:30:06 +13:00
parent 802eaac87b
commit 772994c1c4
2 changed files with 10 additions and 12 deletions

View File

@@ -54,17 +54,11 @@ namespace OpenRA.Mods.RA.Scripting
void Move(Actor actor, CPos dest)
{
if (actor.HasTrait<Aircraft>())
{
if (actor.HasTrait<Helicopter>())
actor.QueueActivity(new HeliFly(actor, Target.FromCell(actor.World, dest)));
else
actor.QueueActivity(new Fly(actor, Target.FromCell(actor.World, dest)));
}
else
{
actor.QueueActivity(new Move.Move(dest, 2));
}
var move = actor.TraitOrDefault<IMove>();
if (move == null)
return;
actor.QueueActivity(move.MoveTo(dest, 2));
}
[Desc("Send reinforcements consisting of multiple units. Supports ground-based, naval and air units. " +

View File

@@ -33,7 +33,11 @@ namespace OpenRA.Mods.RA.Scripting
"close enough to complete the activity.")]
public void AttackMove(CPos cell, int closeEnough = 0)
{
self.QueueActivity(new AttackMove.AttackMoveActivity(self, new Move.Move(cell, WRange.FromCells(closeEnough))));
var move = self.TraitOrDefault<IMove>();
if (move == null)
return;
self.QueueActivity(new AttackMove.AttackMoveActivity(self, move.MoveTo(cell, closeEnough)));
}
}
}