Remove redundant check from SupportPowerInstance.
This commit is contained in:
@@ -203,27 +203,23 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Active)
|
if (!Active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Active)
|
var power = Instances.First();
|
||||||
|
if (Manager.DevMode.FastCharge && remainingSubTicks > 2500)
|
||||||
|
remainingSubTicks = 2500;
|
||||||
|
|
||||||
|
if (remainingSubTicks > 0)
|
||||||
|
remainingSubTicks = (remainingSubTicks - 100).Clamp(0, TotalTicks * 100);
|
||||||
|
|
||||||
|
if (!notifiedCharging)
|
||||||
{
|
{
|
||||||
var power = Instances.First();
|
power.Charging(power.Self, Key);
|
||||||
if (Manager.DevMode.FastCharge && remainingSubTicks > 2500)
|
notifiedCharging = true;
|
||||||
remainingSubTicks = 2500;
|
}
|
||||||
|
|
||||||
if (remainingSubTicks > 0)
|
if (RemainingTicks == 0 && !notifiedReady)
|
||||||
remainingSubTicks = (remainingSubTicks - 100).Clamp(0, TotalTicks * 100);
|
{
|
||||||
|
power.Charged(power.Self, Key);
|
||||||
if (!notifiedCharging)
|
notifiedReady = true;
|
||||||
{
|
|
||||||
power.Charging(power.Self, Key);
|
|
||||||
notifiedCharging = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RemainingTicks == 0
|
|
||||||
&& !notifiedReady)
|
|
||||||
{
|
|
||||||
power.Charged(power.Self, Key);
|
|
||||||
notifiedReady = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user