Check if weapon without self-reloading is out of ammo when deciding validity
This should prevent attacking helicopters (or other actors) staying at the range to target of a weapon that is out of ammo and needs manual reloading at a RearmBuilding or via upgrades.
This commit is contained in:
@@ -80,13 +80,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
|
||||
// Fly towards the target
|
||||
// TODO: Fix that the helicopter won't do anything if it has multiple weapons with different ranges
|
||||
// and the weapon with the longest range is out of ammo
|
||||
if (!target.IsInRange(self.CenterPosition, attackHeli.GetMaximumRangeVersusTarget(target)))
|
||||
helicopter.SetPosition(self, helicopter.CenterPosition + helicopter.FlyStep(desiredFacing));
|
||||
|
||||
// Fly backwards from the target
|
||||
// TODO: Same problem as with MaximumRange
|
||||
if (target.IsInRange(self.CenterPosition, attackHeli.GetMinimumRangeVersusTarget(target)))
|
||||
{
|
||||
// Facing 0 doesn't work with the following position change
|
||||
|
||||
Reference in New Issue
Block a user