Fixed aircraft not being able to hunt
This commit is contained in:
@@ -20,9 +20,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
public class Hunt : Activity
|
||||
{
|
||||
readonly IEnumerable<Actor> targets;
|
||||
readonly IMove move;
|
||||
|
||||
public Hunt(Actor self)
|
||||
{
|
||||
move = self.Trait<IMove>();
|
||||
var attack = self.Trait<AttackBase>();
|
||||
targets = self.World.ActorsHavingTrait<Huntable>().Where(
|
||||
a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
|
||||
@@ -39,7 +41,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
|
||||
return ActivityUtils.SequenceActivities(
|
||||
new AttackMoveActivity(self, new Move(self, target.Location, WDist.FromCells(2))),
|
||||
new AttackMoveActivity(self, move.MoveTo(target.Location, 2)),
|
||||
new Wait(25),
|
||||
this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user