Revert "Units that have turrets while deployed now move their turrets back to their initial positions before undeploying"

This reverts commit d34bea293505f152d5f5aae3806dfcf36104945b.
This commit is contained in:
Paul Chote
2018-12-25 15:38:09 +13:00
committed by Oliver Brakmann
parent 7184f5f97e
commit b41c178cb9
4 changed files with 0 additions and 67 deletions

View File

@@ -24,24 +24,8 @@ namespace OpenRA.Mods.Common.Activities
this.deploy = deploy;
}
protected override void OnFirstRun(Actor self)
{
var tInfo = self.Info.TraitInfoOrDefault<TurretedInfo>();
if (tInfo != null)
QueueChild(new WaitForTurretAlignment(self, tInfo.InitialFacing));
}
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ActivityUtils.RunActivity(self, ChildActivity);
return this;
}
if (IsCanceled)
return NextActivity;
IsInterruptible = false; // must DEPLOY from now.
deploy.Undeploy();

View File

@@ -1,41 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2018 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 WaitForTurretAlignment : Activity
{
readonly Turreted turreted;
readonly int desiredAlignment;
public WaitForTurretAlignment(Actor self, int desiredAlignment)
{
this.turreted = self.Trait<Turreted>();
this.desiredAlignment = desiredAlignment;
}
protected override void OnFirstRun(Actor self)
{
turreted.StopAiming(self);
}
public override Activity Tick(Actor self)
{
turreted.DesiredFacing = desiredAlignment;
if (turreted.HasAchievedDesiredFacing)
return NextActivity;
return this;
}
}
}

View File

@@ -118,7 +118,6 @@
<Compile Include="Activities\UnloadCargo.cs" />
<Compile Include="Activities\Wait.cs" />
<Compile Include="Activities\WaitForTransport.cs" />
<Compile Include="Activities\WaitForTurretAlignment.cs" />
<Compile Include="ActorExts.cs" />
<Compile Include="AI\AIUtils.cs" />
<Compile Include="AI\AttackOrFleeFuzzy.cs" />

View File

@@ -188,15 +188,6 @@ namespace OpenRA.Mods.Common.Traits
return HasAchievedDesiredFacing;
}
public void StopAiming(Actor self)
{
if (IsTraitDisabled)
return;
if (attack != null && attack.IsAiming)
attack.OnStopOrder(self);
}
public virtual bool HasAchievedDesiredFacing
{
get { return DesiredFacing == null || TurretFacing == DesiredFacing.Value; }