Convert support powers from actor disabled to pausable-conditional.

This commit is contained in:
atlimit8
2017-03-16 22:28:43 -05:00
parent 9a1ba31753
commit 431f06cd49
11 changed files with 29 additions and 18 deletions

View File

@@ -179,11 +179,6 @@ namespace OpenRA.Mods.Common.Traits
prereqsAvailable = available;
}
static bool InstanceDisabled(SupportPower sp)
{
return sp.Self.IsDisabled();
}
bool notifiedCharging;
bool notifiedReady;
public void Tick()
@@ -192,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
if (!instancesEnabled)
RemainingTime = TotalTime;
Active = !Disabled && Instances.Any(i => !i.Self.IsDisabled());
Active = !Disabled && Instances.Any(i => !i.IsTraitPaused);
if (!Active)
return;
@@ -224,7 +219,7 @@ namespace OpenRA.Mods.Common.Traits
if (!Ready)
return;
var power = Instances.FirstOrDefault();
var power = Instances.FirstOrDefault(i => !i.IsTraitPaused);
if (power == null)
return;
@@ -236,7 +231,7 @@ namespace OpenRA.Mods.Common.Traits
if (!Ready)
return;
var power = Instances.Where(i => !InstanceDisabled(i))
var power = Instances.Where(i => !i.IsTraitPaused)
.MinByOrDefault(a =>
{
if (a.Self.OccupiesSpace == null)