Allow forced landing on helipads and enforce takeoff otherwise.
This commit is contained in:
@@ -142,6 +142,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
aircraft.MakeReservation(dest);
|
||||
QueueChild(self, new Land(self, Target.FromActor(dest), offset, facing), true);
|
||||
QueueChild(self, new Resupply(self, dest, WDist.Zero), true);
|
||||
if (aircraft.Info.TakeOffOnResupply && !alwaysLand)
|
||||
QueueChild(self, new TakeOff(self));
|
||||
}
|
||||
else
|
||||
QueueChild(self, new Fly(self, Target.FromActor(dest)), true);
|
||||
|
||||
@@ -117,11 +117,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
var aircraft = self.TraitOrDefault<Aircraft>();
|
||||
if (aircraft != null)
|
||||
{
|
||||
aircraft.AllowYieldingReservation();
|
||||
if (aircraft.Info.TakeOffOnResupply)
|
||||
Queue(self, new TakeOff(self));
|
||||
}
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
@@ -129,6 +125,14 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (NextActivity != null)
|
||||
return;
|
||||
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
|
||||
void RepairTick(Actor self)
|
||||
{
|
||||
// First active.
|
||||
|
||||
Reference in New Issue
Block a user