Remove redundant check from SupportPowerInstance.

This commit is contained in:
Paul Chote
2020-08-14 17:10:34 +01:00
committed by reaperrr
parent 7ee4fbeb0d
commit ad75e2be89

View File

@@ -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;
}
} }
} }