Begin to unhack unit movement/cursors; Flying units no longer show move-blocked cursor on water

This commit is contained in:
Paul Chote
2009-12-21 03:09:47 -08:00
parent 7fa1da0d7d
commit 7aea135113
9 changed files with 46 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ using OpenRa.Game.Traits.Activities;
namespace OpenRa.Game.Traits
{
class Plane : IOrder
class Plane : IOrder, IMovement
{
public Plane(Actor self)
{
@@ -19,7 +19,7 @@ namespace OpenRa.Game.Traits
return Order.Move(self, xy);
if (underCursor.Info == Rules.UnitInfo["AFLD"]
&& underCursor.Owner == self.Owner)
return Order.DeliverOre(self, underCursor); /* brutal hack */
return Order.Enter(self, underCursor);
return null;
}
@@ -31,11 +31,21 @@ namespace OpenRa.Game.Traits
self.QueueActivity(new Circle(order.TargetLocation));
}
if (order.OrderString == "DeliverOre")
if (order.OrderString == "Enter")
{
self.CancelActivity();
self.QueueActivity(new ReturnToBase(self, order.TargetActor.CenterLocation));
}
}
public UnitMovementType GetMovementType()
{
return UnitMovementType.Fly;
}
public bool CanEnterCell(int2 location)
{
return true; // Planes can go anywhere (?)
}
}
}