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 */
|
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */
|
||||||
var mobile = order.Subject.traits.GetOrDefault<Mobile>();
|
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;
|
var weapon = order.Subject.unitInfo.Primary ?? order.Subject.unitInfo.Secondary;
|
||||||
|
|
||||||
mobile.Cancel(order.Subject);
|
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(
|
mobile.QueueActivity(
|
||||||
new Traits.Activities.Follow(order.TargetActor, Math.Max(0, (int)range - RangeTolerance)));
|
new Traits.Activities.Follow(order.TargetActor,
|
||||||
}
|
Math.Max(0, (int)Rules.WeaponInfo[weapon].Range - RangeTolerance)));
|
||||||
|
|
||||||
order.Subject.traits.Get<AttackTurreted>().target = order.TargetActor;
|
order.Subject.traits.Get<AttackTurreted>().target = order.TargetActor;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user