removed Mobile.InternalSetActivity
This commit is contained in:
@@ -18,24 +18,20 @@ namespace OpenRa.Game.Traits.Activities
|
||||
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
public void Tick(Actor self, Mobile mobile)
|
||||
public IActivity Tick( Actor self, Mobile mobile )
|
||||
{
|
||||
if (Target.IsDead)
|
||||
{
|
||||
mobile.InternalSetActivity(NextActivity);
|
||||
return;
|
||||
}
|
||||
if (Target == null || Target.IsDead)
|
||||
return NextActivity;
|
||||
|
||||
if ((Target.Location - self.Location).LengthSquared >= Range * Range)
|
||||
{
|
||||
mobile.InternalSetActivity(new Move(Target, Range));
|
||||
mobile.QueueActivity(this);
|
||||
}
|
||||
if( ( Target.Location - self.Location ).LengthSquared >= Range * Range )
|
||||
return new Move( Target, Range ) { NextActivity = this };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self, Mobile mobile)
|
||||
{
|
||||
mobile.InternalSetActivity(null);
|
||||
Target = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user