This commit is contained in:
@@ -27,17 +27,13 @@ namespace OpenRa.Game
|
||||
{
|
||||
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */
|
||||
var mobile = order.Subject.traits.GetOrDefault<Mobile>();
|
||||
/* todo: choose the appropriate weapon, when only one works against this target */
|
||||
var weapon = order.Subject.unitInfo.Primary ?? order.Subject.unitInfo.Secondary;
|
||||
|
||||
mobile.Cancel(order.Subject);
|
||||
// TODO: this block should be a separate activity; "MoveNear", maybe?
|
||||
{
|
||||
/* todo: choose the appropriate weapon, when only one works against this target */
|
||||
var range = Rules.WeaponInfo[weapon].Range;
|
||||
|
||||
mobile.QueueActivity(
|
||||
new Traits.Activities.Follow(order.TargetActor, Math.Max(0, (int)range - RangeTolerance)));
|
||||
}
|
||||
mobile.QueueActivity(
|
||||
new Traits.Activities.Follow(order.TargetActor,
|
||||
Math.Max(0, (int)Rules.WeaponInfo[weapon].Range - RangeTolerance)));
|
||||
|
||||
order.Subject.traits.Get<AttackTurreted>().target = order.TargetActor;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user