remove DeathWeapon; IExplodeModifier implemented for resource actors (and for V2, which was the original purpose)

This commit is contained in:
Chris Forbes
2010-07-05 17:43:20 +12:00
parent 68b63dc89e
commit 2ed8045736
6 changed files with 20 additions and 39 deletions

View File

@@ -18,6 +18,7 @@
*/
#endregion
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
@@ -49,12 +50,10 @@ namespace OpenRA.Mods.RA
string ChooseWeaponForExplosion(Actor self)
{
var shouldExplode = self.traits.WithInterface<IExplodeModifier>().All(a => a.ShouldExplode(self));
var info = self.Info.Traits.Get<ExplodesInfo>();
var attack = self.traits.GetOrDefault<AttackBase>();
if (attack == null) return info.Weapon;
return attack.IsReloading() ? info.EmptyWeapon : info.Weapon;
return shouldExplode ? info.Weapon : info.EmptyWeapon;
}
}
}