Fix for #6161 queue commands for Plane/Heli (do not ignore Order.Queued in ResolveOrder())
This commit is contained in:
@@ -84,4 +84,26 @@ namespace OpenRA.Mods.Common.Activities
|
||||
yield return target;
|
||||
}
|
||||
}
|
||||
|
||||
public class FlyAndContinueWithCirclesWhenIdle : Fly
|
||||
{
|
||||
public FlyAndContinueWithCirclesWhenIdle(Actor self, Target t)
|
||||
: base(self, t) { }
|
||||
|
||||
public FlyAndContinueWithCirclesWhenIdle(Actor self, Target t, WDist minRange, WDist maxRange)
|
||||
: base(self, t, minRange, maxRange) { }
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
var activity = base.Tick(self);
|
||||
|
||||
if (activity == null && !IsCanceled)
|
||||
{
|
||||
self.QueueActivity(new FlyCircle(self));
|
||||
activity = NextActivity;
|
||||
}
|
||||
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,30 @@ namespace OpenRA.Mods.Common.Activities
|
||||
yield return target;
|
||||
}
|
||||
}
|
||||
|
||||
public class HeliFlyAndLandWhenIdle : HeliFly
|
||||
{
|
||||
private readonly HelicopterInfo info;
|
||||
|
||||
public HeliFlyAndLandWhenIdle(Actor self, Target t, HelicopterInfo info)
|
||||
: base(self, t)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
var activity = base.Tick(self);
|
||||
|
||||
if (activity == null && !IsCanceled && info.LandWhenIdle)
|
||||
{
|
||||
if (info.TurnToLand)
|
||||
self.QueueActivity(new Turn(self, info.InitialFacing));
|
||||
self.QueueActivity(new HeliLand(self, true));
|
||||
activity = NextActivity;
|
||||
}
|
||||
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
self.CancelActivity();
|
||||
if (NextActivity == null)
|
||||
self.CancelActivity();
|
||||
|
||||
var reservation = aircraft.Reservation;
|
||||
if (reservation != null)
|
||||
@@ -43,7 +44,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
var destination = rp != null ? rp.Location :
|
||||
(hasHost ? self.World.Map.CellContaining(host.CenterPosition) : self.Location);
|
||||
|
||||
return new AttackMoveActivity(self, move.MoveTo(destination, 1));
|
||||
if (NextActivity == null)
|
||||
return new AttackMoveActivity(self, move.MoveTo(destination, 1));
|
||||
else
|
||||
return NextActivity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user