Merge pull request #13020 from abcdefg30/airHunt
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
|
public class Hunt : Activity
|
||||||
{
|
{
|
||||||
readonly IEnumerable<Actor> targets;
|
readonly IEnumerable<Actor> targets;
|
||||||
|
readonly IMove move;
|
||||||
|
|
||||||
public Hunt(Actor self)
|
public Hunt(Actor self)
|
||||||
{
|
{
|
||||||
|
move = self.Trait<IMove>();
|
||||||
var attack = self.Trait<AttackBase>();
|
var attack = self.Trait<AttackBase>();
|
||||||
targets = self.World.ActorsHavingTrait<Huntable>().Where(
|
targets = self.World.ActorsHavingTrait<Huntable>().Where(
|
||||||
a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
|
a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
|
||||||
@@ -39,7 +41,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
return this;
|
return this;
|
||||||
|
|
||||||
return ActivityUtils.SequenceActivities(
|
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),
|
new Wait(25),
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user