Allow Attack activities to target FrozenActors directly.
Removing the legacy FrozenActor to Actor workaround fixes a number of long-standing bugs. This also prevents units from losing their target when it transforms into a different actor type.
This commit is contained in:
committed by
Oliver Brakmann
parent
0406b89a96
commit
c34dd4b824
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -32,9 +33,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// Some 3rd-party mods rely on this being public
|
||||
public class SetTarget : Activity
|
||||
{
|
||||
readonly Target target;
|
||||
readonly AttackOmni attack;
|
||||
readonly bool allowMove;
|
||||
Target target;
|
||||
|
||||
public SetTarget(AttackOmni attack, Target target, bool allowMove)
|
||||
{
|
||||
@@ -45,6 +46,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
target = target.Recalculate(self.Owner);
|
||||
if (IsCanceled || !target.IsValidFor(self) || !attack.IsReachableTarget(target, allowMove))
|
||||
return NextActivity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user