removes componentdependencies (#6160)
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Content.Server.Singularity.Components
|
||||
public class RadiationCollectorComponent : Component, IInteractHand, IRadiationAct
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
public override string Name => "RadiationCollector";
|
||||
private bool _enabled;
|
||||
@@ -32,8 +33,6 @@ namespace Content.Server.Singularity.Components
|
||||
}
|
||||
}
|
||||
|
||||
[ComponentDependency] private readonly BatteryComponent? _batteryComponent = default!;
|
||||
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
var curTime = _gameTiming.CurTime;
|
||||
@@ -66,9 +65,9 @@ namespace Content.Server.Singularity.Components
|
||||
// But the previous logic would also make the radiation collectors never ever stop providing energy.
|
||||
// And since frameTime was used there, I'm assuming that this is what the intent was.
|
||||
// This still won't stop things being potentially hilarously unbalanced though.
|
||||
if (_batteryComponent != null)
|
||||
if (_entMan.TryGetComponent<BatteryComponent>(Owner, out var batteryComponent))
|
||||
{
|
||||
_batteryComponent!.CurrentCharge += frameTime * radiation.RadsPerSecond * 3000f;
|
||||
batteryComponent.CurrentCharge += frameTime * radiation.RadsPerSecond * 3000f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user