Fix cheats reenabling OneShot support powers.
This commit is contained in:
committed by
Matthias Mailänder
parent
3af0b1a7a0
commit
48a018d994
@@ -160,13 +160,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public int RemainingTime;
|
public int RemainingTime;
|
||||||
public int TotalTime;
|
public int TotalTime;
|
||||||
public bool Active { get; private set; }
|
public bool Active { get; private set; }
|
||||||
public bool Disabled { get { return (!prereqsAvailable && !manager.DevMode.AllTech) || !instancesEnabled; } }
|
public bool Disabled { get { return (!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 && RemainingTime == 0; } }
|
public bool Ready { get { return Active && RemainingTime == 0; } }
|
||||||
|
|
||||||
bool instancesEnabled;
|
bool instancesEnabled;
|
||||||
bool prereqsAvailable = true;
|
bool prereqsAvailable = true;
|
||||||
|
bool oneShotFired;
|
||||||
|
|
||||||
public SupportPowerInstance(string key, SupportPowerManager manager)
|
public SupportPowerInstance(string key, SupportPowerManager manager)
|
||||||
{
|
{
|
||||||
@@ -249,7 +250,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
notifiedCharging = notifiedReady = false;
|
notifiedCharging = notifiedReady = false;
|
||||||
|
|
||||||
if (Info.OneShot)
|
if (Info.OneShot)
|
||||||
|
{
|
||||||
PrerequisitesAvailable(false);
|
PrerequisitesAvailable(false);
|
||||||
|
oneShotFired = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user