fixed 741 -- use the correct superweapon building when more than one is available and some are disabled
This commit is contained in:
@@ -131,12 +131,17 @@ namespace OpenRA.Mods.RA
|
|||||||
Manager = manager;
|
Manager = manager;
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool InstanceDisabled(SupportPower sp)
|
||||||
|
{
|
||||||
|
return sp.self.TraitsImplementing<IDisable>().Any(d => d.Disabled);
|
||||||
|
}
|
||||||
|
|
||||||
bool notifiedCharging;
|
bool notifiedCharging;
|
||||||
bool notifiedReady;
|
bool notifiedReady;
|
||||||
public void Tick()
|
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)
|
if (Active)
|
||||||
{
|
{
|
||||||
@@ -173,7 +178,8 @@ namespace OpenRA.Mods.RA
|
|||||||
if (!Ready)
|
if (!Ready)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var power = Instances.First();
|
var power = Instances.First(i => !InstanceDisabled(i));
|
||||||
|
|
||||||
// Note: order.Subject is the *player* actor
|
// Note: order.Subject is the *player* actor
|
||||||
power.Activate(power.self, order);
|
power.Activate(power.self, order);
|
||||||
RemainingTime = TotalTime;
|
RemainingTime = TotalTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user