more... Combat.GetSecondaryWeapon() dies, etc

This commit is contained in:
Chris Forbes
2010-07-31 18:04:02 +12:00
parent 449cc4a42d
commit 9fcc739cd5
3 changed files with 8 additions and 17 deletions

View File

@@ -50,13 +50,13 @@ namespace OpenRA.Mods.RA
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 = order.Subject.GetPrimaryWeapon() ?? order.Subject.GetSecondaryWeapon();
var weapon = ChooseWeaponForTarget(Target.FromOrder(order));
target = Target.FromOrder(order);
if (self.traits.Contains<Mobile>())
self.QueueActivity( new Follow( target,
Math.Max( 0, (int)weapon.Range - RangeTolerance ) ) );
Math.Max( 0, (int)weapon.Info.Range - RangeTolerance ) ) );
}
bool buildComplete = false;