Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Nov 1, 2024
1 parent 407339d commit 99476e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Content.Server/_Sunrise/Synth/SynthSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
using Content.Shared.Verbs;
using Robust.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Server.Containers;
using Robust.Shared.Containers;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
Expand All @@ -41,7 +41,7 @@ public sealed class SynthSystem : SharedSynthSystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly BatterySystem _batterySystem = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
Expand Down Expand Up @@ -233,8 +233,11 @@ private bool TryGetBattery(EntityUid uid, [NotNullWhen(true)] out EntityUid? pow
{
powercell = null;
batteryComponent = null;

if (!TryComp(uid, out ContainerManagerComponent? containerComp))
return false;

if (_containerSystem.TryGetContainer(uid, "cell_slot", out var container) && container.ContainedEntities.Count > 0)
if (_containerSystem.TryGetContainer(uid, "cell_slot", out var container, containerComp) && container.ContainedEntities.Count > 0)
{
foreach (var content in container.ContainedEntities)
{
Expand Down Expand Up @@ -306,6 +309,7 @@ private bool TryChangeEnergy(EntityUid uid, FixedPoint2 delta, SynthComponent? c
{
_batterySystem.SetCharge(battery.Value, newEnergy.Float(), batteryComponent);
component.Energy = newEnergy.Float();
component.MaxEnergy = batteryComponent.MaxCharge;
}

switch (component.SlowState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
- type: ActivatableUI
key: enum.BorgUiKey.Key
- type: BorgChassis
brainContainerId: "synth_brain"
- type: LockingWhitelist
blacklist:
components:
Expand Down

0 comments on commit 99476e0

Please sign in to comment.