allow queueing on Mobile
This commit is contained in:
@@ -53,6 +53,8 @@ namespace OpenRA
|
|||||||
: this(orderString, subject, targetActor, int2.Zero, null, false) { }
|
: this(orderString, subject, targetActor, int2.Zero, null, false) { }
|
||||||
public Order(string orderString, Actor subject, int2 targetLocation)
|
public Order(string orderString, Actor subject, int2 targetLocation)
|
||||||
: this(orderString, subject, null, targetLocation, null, false) { }
|
: 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)
|
public Order(string orderString, Actor subject, string targetString)
|
||||||
: this(orderString, subject, null, int2.Zero, targetString, false) { }
|
: this(orderString, subject, null, int2.Zero, targetString, false) { }
|
||||||
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation)
|
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace OpenRA.Traits
|
|||||||
var umt = self.Info.Traits.Get<MobileInfo>().MovementType;
|
var umt = self.Info.Traits.Get<MobileInfo>().MovementType;
|
||||||
if (Util.GetEffectiveSpeed(self,umt) == 0) return null; /* allow disabling move orders from modifiers */
|
if (Util.GetEffectiveSpeed(self,umt) == 0) return null; /* allow disabling move orders from modifiers */
|
||||||
if (xy == toCell) return null;
|
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)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Traits
|
|||||||
{
|
{
|
||||||
if (self.traits.GetOrDefault<IMovement>().CanEnterCell(order.TargetLocation))
|
if (self.traits.GetOrDefault<IMovement>().CanEnterCell(order.TargetLocation))
|
||||||
{
|
{
|
||||||
self.CancelActivity();
|
if( !order.Queued ) self.CancelActivity();
|
||||||
self.QueueActivity(new Activities.Move(order.TargetLocation, 8));
|
self.QueueActivity(new Activities.Move(order.TargetLocation, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user