Remove WaitForTransport activity.

This commit is contained in:
tovl
2019-07-17 22:15:03 +02:00
committed by teinarss
parent 922c6e9c40
commit 231825d0d0
3 changed files with 2 additions and 52 deletions

View File

@@ -113,15 +113,9 @@ namespace OpenRA.Mods.Common.Activities
var delta = (self.CenterPosition - host.CenterPosition).LengthSquared;
var transport = transportCallers.FirstOrDefault(t => t.MinimumDistance.LengthSquared < delta);
if (transport != null)
{
QueueChild(new WaitForTransport(self, moveActivities));
// TODO: Make this compatible with RepairableNear
transport.RequestTransport(self, targetCell);
}
else
QueueChild(moveActivities);
QueueChild(moveActivities);
return false;
}

View File

@@ -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;
}
}
}

View File

@@ -122,11 +122,8 @@ namespace OpenRA.Mods.Common.Traits
if (!CanRepairAt(order.Target.Actor) || (!CanRepair() && !CanRearm()))
return;
if (!order.Queued)
self.CancelActivity();
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()