fixed 741 -- use the correct superweapon building when more than one is available and some are disabled

This commit is contained in:
Chris Forbes
2011-05-30 21:26:05 +12:00
parent 7ac57014fb
commit 61cde675ea

View File

@@ -131,12 +131,17 @@ namespace OpenRA.Mods.RA
Manager = manager;
Key = key;
}
static bool InstanceDisabled(SupportPower sp)
{
return sp.self.TraitsImplementing<IDisable>().Any(d => d.Disabled);
}
bool notifiedCharging;
bool notifiedReady;
public void Tick()
{
Active = !Disabled && Instances.Any(i => !i.self.TraitsImplementing<IDisable>().Any(d => d.Disabled));
Active = !Disabled && Instances.Any(i => !InstanceDisabled(i));
if (Active)
{
@@ -173,7 +178,8 @@ namespace OpenRA.Mods.RA
if (!Ready)
return;
var power = Instances.First();
var power = Instances.First(i => !InstanceDisabled(i));
// Note: order.Subject is the *player* actor
power.Activate(power.self, order);
RemainingTime = TotalTime;