Restore 6e13cb7f3 (lost while rebasing).
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.AI
|
|||||||
internal HackyAI bot;
|
internal HackyAI bot;
|
||||||
internal XRandom random;
|
internal XRandom random;
|
||||||
|
|
||||||
internal Actor target;
|
internal Target target;
|
||||||
internal StateMachine fsm;
|
internal StateMachine fsm;
|
||||||
|
|
||||||
//fuzzy
|
//fuzzy
|
||||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA.AI
|
|||||||
this.world = bot.world;
|
this.world = bot.world;
|
||||||
this.random = bot.random;
|
this.random = bot.random;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.target = target;
|
this.target = Traits.Target.FromActor(target);
|
||||||
fsm = new StateMachine();
|
fsm = new StateMachine();
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
@@ -70,14 +70,13 @@ namespace OpenRA.Mods.RA.AI
|
|||||||
|
|
||||||
public Actor Target
|
public Actor Target
|
||||||
{
|
{
|
||||||
get { return target; }
|
get { return target.Actor; }
|
||||||
set { target = value; }
|
set { target = Traits.Target.FromActor(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TargetIsValid
|
public bool TargetIsValid
|
||||||
{
|
{
|
||||||
get { return (target != null && !target.IsDead() && !target.Destroyed
|
get { return target.IsValidFor(units.FirstOrDefault()) && !target.Actor.HasTrait<Husk>(); }
|
||||||
&& target.IsInWorld && !target.HasTrait<Husk>()); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public WPos CenterPosition { get { return units.Select(u => u.CenterPosition).Average(); } }
|
public WPos CenterPosition { get { return units.Select(u => u.CenterPosition).Average(); } }
|
||||||
|
|||||||
Reference in New Issue
Block a user