fixing some more bits

This commit is contained in:
Chris Forbes
2010-01-12 15:47:11 +13:00
parent 275100938d
commit df330f3151
6 changed files with 26 additions and 17 deletions

View File

@@ -36,11 +36,11 @@ namespace OpenRa.Game.Traits
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.LegacyInfo.Primary ?? order.Subject.LegacyInfo.Secondary;
var weapon = order.Subject.GetPrimaryWeapon() ?? order.Subject.GetSecondaryWeapon();
if (self.traits.Contains<Mobile>())
self.QueueActivity( new Traits.Activities.Follow( order.TargetActor,
Math.Max( 0, (int)Rules.WeaponInfo[ weapon ].Range - RangeTolerance ) ) );
Math.Max( 0, (int)weapon.Range - RangeTolerance ) ) );
target = order.TargetActor;