Remove WaitForTransport activity.
This commit is contained in:
@@ -113,15 +113,9 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
var delta = (self.CenterPosition - host.CenterPosition).LengthSquared;
|
var delta = (self.CenterPosition - host.CenterPosition).LengthSquared;
|
||||||
var transport = transportCallers.FirstOrDefault(t => t.MinimumDistance.LengthSquared < delta);
|
var transport = transportCallers.FirstOrDefault(t => t.MinimumDistance.LengthSquared < delta);
|
||||||
if (transport != null)
|
if (transport != null)
|
||||||
{
|
|
||||||
QueueChild(new WaitForTransport(self, moveActivities));
|
|
||||||
|
|
||||||
// TODO: Make this compatible with RepairableNear
|
|
||||||
transport.RequestTransport(self, targetCell);
|
transport.RequestTransport(self, targetCell);
|
||||||
}
|
|
||||||
else
|
|
||||||
QueueChild(moveActivities);
|
|
||||||
|
|
||||||
|
QueueChild(moveActivities);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +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 WaitForTransport : Activity
|
|
||||||
{
|
|
||||||
readonly ICallForTransport transportable;
|
|
||||||
readonly Activity inner;
|
|
||||||
|
|
||||||
public WaitForTransport(Actor self, Activity inner)
|
|
||||||
{
|
|
||||||
transportable = self.TraitOrDefault<ICallForTransport>();
|
|
||||||
this.inner = inner;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnFirstRun(Actor self)
|
|
||||||
{
|
|
||||||
QueueChild(inner);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Tick(Actor self)
|
|
||||||
{
|
|
||||||
if (transportable != null)
|
|
||||||
transportable.MovementCancelled(self);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -122,11 +122,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!CanRepairAt(order.Target.Actor) || (!CanRepair() && !CanRearm()))
|
if (!CanRepairAt(order.Target.Actor) || (!CanRepair() && !CanRearm()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!order.Queued)
|
|
||||||
self.CancelActivity();
|
|
||||||
|
|
||||||
self.SetTargetLine(order.Target, Color.Green);
|
self.SetTargetLine(order.Target, Color.Green);
|
||||||
self.QueueActivity(new Resupply(self, order.Target.Actor, new WDist(512)));
|
self.QueueActivity(order.Queued, new Resupply(self, order.Target.Actor, new WDist(512)));
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<VariableObserver> IObservesVariables.GetVariableObservers()
|
IEnumerable<VariableObserver> IObservesVariables.GetVariableObservers()
|
||||||
|
|||||||
Reference in New Issue
Block a user