tidy up disabled handling

This commit is contained in:
Chris Forbes
2012-04-06 19:34:43 +12:00
parent aa21ddaa4d
commit 10c1b996ed
9 changed files with 36 additions and 41 deletions

View File

@@ -24,8 +24,7 @@ namespace OpenRA.Mods.RA
bool UpdateActive(Actor self)
{
// Check if powered
if (self.TraitsImplementing<IDisable>().Any(d => d.Disabled))
return false;
if (self.IsDisabled()) return false;
var isJammed = self.World.ActorsWithTrait<JamsRadar>().Any(a => self.Owner != a.Actor.Owner
&& (self.Location - a.Actor.Location).Length < a.Actor.Info.Traits.Get<JamsRadarInfo>().Range);