Remove ResupplyAircraft and AllowYieldingReservation
The few extra things those two activities did can be done in Resupply, making them redundant.
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. For more
|
||||
* information, see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
public class AllowYieldingReservation : Activity
|
||||
{
|
||||
readonly Aircraft aircraft;
|
||||
|
||||
public AllowYieldingReservation(Actor self)
|
||||
{
|
||||
aircraft = self.Trait<Aircraft>();
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
aircraft.AllowYieldingReservation();
|
||||
return NextActivity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. For more
|
||||
* information, see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
public class ResupplyAircraft : Activity
|
||||
{
|
||||
public ResupplyAircraft(Actor self) { }
|
||||
|
||||
protected override void OnFirstRun(Actor self)
|
||||
{
|
||||
var aircraft = self.Trait<Aircraft>();
|
||||
var host = aircraft.GetActorBelow();
|
||||
|
||||
if (host == null)
|
||||
return;
|
||||
|
||||
QueueChild(self, new Resupply(self, host, WDist.Zero));
|
||||
QueueChild(self, new AllowYieldingReservation(self));
|
||||
if (aircraft.Info.TakeOffOnResupply)
|
||||
QueueChild(self, new TakeOff(self, (a, b, c) => NextActivity == null && b.NextActivity == null));
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (ChildActivity != null)
|
||||
{
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
return this;
|
||||
}
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
else
|
||||
QueueChild(self, new Land(self, Target.FromPos(dest.CenterPosition + offset), true, dest), true);
|
||||
|
||||
QueueChild(self, new ResupplyAircraft(self), true);
|
||||
QueueChild(self, new Resupply(self, dest, WDist.Zero), true);
|
||||
resupplied = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,17 @@ namespace OpenRA.Mods.Common.Activities
|
||||
notifyResupply.ResupplyTick(host.Actor, self, activeResupplyTypes);
|
||||
|
||||
if (activeResupplyTypes == 0)
|
||||
{
|
||||
var aircraft = self.TraitOrDefault<Aircraft>();
|
||||
if (aircraft != null)
|
||||
{
|
||||
aircraft.AllowYieldingReservation();
|
||||
if (aircraft.Info.TakeOffOnResupply)
|
||||
Queue(self, new TakeOff(self, (a, b, c) => NextActivity == null && b.NextActivity == null));
|
||||
}
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user