diff --git a/OpenRa.Game/UnitOrders.cs b/OpenRa.Game/UnitOrders.cs index 99069a5390..490b2143a3 100755 --- a/OpenRa.Game/UnitOrders.cs +++ b/OpenRa.Game/UnitOrders.cs @@ -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(); + /* 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().target = order.TargetActor; break;