Add IMove interface.

Fixes Rallypoints for aircraft.
This commit is contained in:
Paul Chote
2013-08-09 23:36:01 +12:00
parent a6ee4daf58
commit 3b3e6edc90
5 changed files with 21 additions and 14 deletions

View File

@@ -94,19 +94,11 @@ namespace OpenRA.Mods.RA
if (rp == null)
return exitLocation;
var mobile = newUnit.TraitOrDefault<Mobile>();
if (mobile != null)
var move = newUnit.TraitOrDefault<IMove>();
if (move != null)
{
newUnit.QueueActivity(new AttackMove.AttackMoveActivity(
newUnit, mobile.MoveTo(rp.rallyPoint, rp.nearEnough)));
return rp.rallyPoint;
}
// TODO: don't talk about HeliFly here.
var helicopter = newUnit.TraitOrDefault<Helicopter>();
if (helicopter != null)
{
newUnit.QueueActivity(new HeliFly(rp.rallyPoint));
newUnit, move.MoveTo(rp.rallyPoint, rp.nearEnough)));
return rp.rallyPoint;
}