Disable SupportPowerInstances when player lost
Fixes bots using player actor powers after defeat.
This commit is contained in:
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
||||||
{
|
{
|
||||||
if (a.Owner != Self.Owner || !a.Info.HasTraitInfo<SupportPowerInfo>())
|
if (Powers.Count == 0 || a.Owner != Self.Owner || !a.Info.HasTraitInfo<SupportPowerInfo>())
|
||||||
return NoInstances;
|
return NoInstances;
|
||||||
|
|
||||||
return a.TraitsImplementing<SupportPower>()
|
return a.TraitsImplementing<SupportPower>()
|
||||||
@@ -151,7 +151,16 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected int remainingSubTicks;
|
protected int remainingSubTicks;
|
||||||
public int RemainingTicks { get { return remainingSubTicks / 100; } }
|
public int RemainingTicks { get { return remainingSubTicks / 100; } }
|
||||||
public bool Active { get; private set; }
|
public bool Active { get; private set; }
|
||||||
public bool Disabled { get { return (!prereqsAvailable && !Manager.DevMode.AllTech) || !instancesEnabled || oneShotFired; } }
|
public bool Disabled
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Manager.Self.Owner.WinState == WinState.Lost ||
|
||||||
|
(!prereqsAvailable && !Manager.DevMode.AllTech) ||
|
||||||
|
!instancesEnabled ||
|
||||||
|
oneShotFired;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public SupportPowerInfo Info { get { return Instances.Select(i => i.Info).FirstOrDefault(); } }
|
public SupportPowerInfo Info { get { return Instances.Select(i => i.Info).FirstOrDefault(); } }
|
||||||
public bool Ready { get { return Active && RemainingTicks == 0; } }
|
public bool Ready { get { return Active && RemainingTicks == 0; } }
|
||||||
|
|||||||
Reference in New Issue
Block a user