Some cleanups

This commit is contained in:
penev92
2015-07-04 16:16:33 +03:00
parent 41cdc57ea5
commit c3fcd9a8a1
7 changed files with 16 additions and 17 deletions

View File

@@ -13,7 +13,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Activities;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Warheads;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -101,8 +101,11 @@ namespace OpenRA.Mods.Common.Traits
{
get
{
if (IsTraitDisabled)
yield break;
var armament = Armaments.FirstOrDefault(a => a.Weapon.Warheads.Any(w => (w is DamageWarhead)));
if (armament == null || IsTraitDisabled)
if (armament == null)
yield break;
var negativeDamage = (armament.Weapon.Warheads.FirstOrDefault(w => (w is DamageWarhead)) as DamageWarhead).Damage < 0;