Fix a minor warning in BatterySystem.cs (#36726)
change timing from protected to private, rename, and adjust references.
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class BatterySystem : EntitySystem
|
public sealed class BatterySystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] protected readonly IGameTiming Timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
|
|
||||||
if (comp.AutoRechargePause)
|
if (comp.AutoRechargePause)
|
||||||
{
|
{
|
||||||
if (comp.NextAutoRecharge > Timing.CurTime)
|
if (comp.NextAutoRecharge > _timing.CurTime)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
if (value < 0)
|
if (value < 0)
|
||||||
value = batteryself.AutoRechargePauseTime;
|
value = batteryself.AutoRechargePauseTime;
|
||||||
|
|
||||||
if (Timing.CurTime + TimeSpan.FromSeconds(value) <= batteryself.NextAutoRecharge)
|
if (_timing.CurTime + TimeSpan.FromSeconds(value) <= batteryself.NextAutoRecharge)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetChargeCooldown(uid, batteryself.AutoRechargePauseTime, batteryself);
|
SetChargeCooldown(uid, batteryself.AutoRechargePauseTime, batteryself);
|
||||||
@@ -194,9 +194,9 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (value >= 0)
|
if (value >= 0)
|
||||||
batteryself.NextAutoRecharge = Timing.CurTime + TimeSpan.FromSeconds(value);
|
batteryself.NextAutoRecharge = _timing.CurTime + TimeSpan.FromSeconds(value);
|
||||||
else
|
else
|
||||||
batteryself.NextAutoRecharge = Timing.CurTime;
|
batteryself.NextAutoRecharge = _timing.CurTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user