fix half of the "range-2" bug.

This commit is contained in:
Bob
2010-04-03 00:49:42 +12:00
committed by Chris Forbes
parent f0d9ad8727
commit def6eee63c

View File

@@ -248,12 +248,11 @@ namespace OpenRA.Traits
protected virtual void QueueAttack(Actor self, Order order)
{
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */
/* todo: choose the appropriate weapon, when only one works against this target */
var weapon = self.GetPrimaryWeapon() ?? self.GetSecondaryWeapon();
self.QueueActivity(new Activities.Attack(order.TargetActor,
Math.Max(0, (int)weapon.Range - RangeTolerance)));
Math.Max(0, (int)weapon.Range)));
}
}
}