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:
reaperrr
2016-06-17 13:14:15 +02:00
parent 2f1a6e8807
commit 4f55b088eb
3 changed files with 16 additions and 4 deletions

View File

@@ -259,6 +259,7 @@ namespace OpenRA.Mods.Common.Traits
public bool IsReloading { get { return FireDelay > 0 || IsTraitDisabled; } }
public bool ShouldExplode(Actor self) { return !IsReloading; }
public bool OutOfAmmo { get { return ammoPool != null && !ammoPool.Info.SelfReloads && !ammoPool.HasAmmo(); } }
public WVec MuzzleOffset(Actor self, Barrel b)
{