allow queueing on Mobile

This commit is contained in:
Bob
2010-05-31 14:24:35 +12:00
parent 1e570b5edb
commit 493dec031b
2 changed files with 4 additions and 2 deletions

View File

@@ -53,6 +53,8 @@ namespace OpenRA
: this(orderString, subject, targetActor, int2.Zero, null, false) { }
public Order(string orderString, Actor subject, int2 targetLocation)
: this(orderString, subject, null, targetLocation, null, false) { }
public Order(string orderString, Actor subject, int2 targetLocation, bool queued)
: this(orderString, subject, null, targetLocation, null, queued) { }
public Order(string orderString, Actor subject, string targetString)
: this(orderString, subject, null, int2.Zero, targetString, false) { }
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation)

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Traits
var umt = self.Info.Traits.Get<MobileInfo>().MovementType;
if (Util.GetEffectiveSpeed(self,umt) == 0) return null; /* allow disabling move orders from modifiers */
if (xy == toCell) return null;
return new Order("Move", self, xy);
return new Order("Move", self, xy, mi.Modifiers.HasModifier(Modifiers.Shift));
}
public void ResolveOrder(Actor self, Order order)
@@ -96,7 +96,7 @@ namespace OpenRA.Traits
{
if (self.traits.GetOrDefault<IMovement>().CanEnterCell(order.TargetLocation))
{
self.CancelActivity();
if( !order.Queued ) self.CancelActivity();
self.QueueActivity(new Activities.Move(order.TargetLocation, 8));
}
}