GetPrimaryWeapon() dies too.

This commit is contained in:
Chris Forbes
2010-07-31 18:26:57 +12:00
parent d202e27f79
commit 9a218f7b52
5 changed files with 7 additions and 18 deletions

View File

@@ -126,6 +126,9 @@ namespace OpenRA.Mods.RA
facing = 0
};
if (args.weapon.Report != null)
Sound.Play(args.weapon.Report + ".aud", pos);
DoImpacts(args);
}
@@ -176,17 +179,6 @@ namespace OpenRA.Mods.RA
return true;
}
public static WeaponInfo GetPrimaryWeapon(this Actor self)
{
var info = self.Info.Traits.GetOrDefault<AttackBaseInfo>();
if (info == null) return null;
var weapon = info.PrimaryWeapon;
if (weapon == null) return null;
return Rules.Weapons[weapon.ToLowerInvariant()];
}
static float2 GetRecoil(Actor self, float recoil)
{
var abInfo = self.Info.Traits.GetOrDefault<AttackBaseInfo>();