Skip to content

Commit

Permalink
Фиксим электроэнергию?
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 committed Apr 16, 2024
1 parent 6b09e3c commit 807452f
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 57 deletions.
6 changes: 3 additions & 3 deletions Content.Server/Power/Components/CableVisComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
public sealed partial class CableVisComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("node")]
public string? Node;
[DataField("node", required:true)]
public string Node;
}
}
}
5 changes: 3 additions & 2 deletions Content.Server/Power/EntitySystems/CableSystem.Placer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Interaction;
using Content.Shared.Maps;
using Content.Shared.Stacks;
using Robust.Shared.Map.Components;

namespace Content.Server.Power.EntitySystems;

Expand All @@ -25,7 +26,7 @@ private void OnCablePlacerAfterInteract(Entity<CablePlacerComponent> placer, ref
if (component.CablePrototypeId == null)
return;

if(!_mapManager.TryGetGrid(args.ClickLocation.GetGridUid(EntityManager), out var grid))
if(!TryComp<MapGridComponent>(args.ClickLocation.GetGridUid(EntityManager), out var grid))
return;

var snapPos = grid.TileIndicesFor(args.ClickLocation);
Expand All @@ -48,4 +49,4 @@ private void OnCablePlacerAfterInteract(Entity<CablePlacerComponent> placer, ref
$"{ToPrettyString(args.User):player} placed {ToPrettyString(newCable):cable} at {Transform(newCable).Coordinates}");
args.Handled = true;
}
}
}
7 changes: 1 addition & 6 deletions Content.Server/Power/EntitySystems/CableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Tools;
using Content.Shared.Tools.Components;
using Robust.Shared.Map;
using System.Xml.Schema;
using CableCuttingFinishedEvent = Content.Shared.Tools.Systems.CableCuttingFinishedEvent;
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;

namespace Content.Server.Power.EntitySystems;

public sealed partial class CableSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileManager = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogs = default!;
[Dependency] private readonly PowerMonitoringConsoleSystem _powerMonitoringSystem = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -80,4 +75,4 @@ private void OnAnchorChanged(EntityUid uid, CableComponent cable, ref AnchorStat
Spawn(cable.CableDroppedOnCutPrototype, Transform(uid).Coordinates);
QueueDel(uid);
}
}
}
15 changes: 5 additions & 10 deletions Content.Server/Power/EntitySystems/CableVisSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
using Content.Server.Power.Nodes;
using Content.Shared.Wires;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;

namespace Content.Server.Power.EntitySystems
{
[UsedImplicitly]
public sealed class CableVisSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;

Expand All @@ -25,14 +23,11 @@ public override void Initialize()

private void UpdateAppearance(EntityUid uid, CableVisComponent cableVis, ref NodeGroupsRebuilt args)
{
if (!TryComp(uid, out NodeContainerComponent? nodeContainer) || !TryComp(uid, out AppearanceComponent? appearance))
return;

if (!_nodeContainer.TryGetNode<CableNode>(nodeContainer, cableVis.Node, out var node))
if (!_nodeContainer.TryGetNode(uid, cableVis.Node, out CableNode? node))

Check failure on line 26 in Content.Server/Power/EntitySystems/CableVisSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 26 in Content.Server/Power/EntitySystems/CableVisSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 26 in Content.Server/Power/EntitySystems/CableVisSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 26 in Content.Server/Power/EntitySystems/CableVisSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'
return;

var transform = Transform(uid);
if (!_mapManager.TryGetGrid(transform.GridUid, out var grid))
if (!TryComp<MapGridComponent>(transform.GridUid, out var grid))
return;

var mask = WireVisDirFlags.None;
Expand All @@ -57,7 +52,7 @@ private void UpdateAppearance(EntityUid uid, CableVisComponent cableVis, ref Nod
};
}

_appearance.SetData(uid, WireVisVisuals.ConnectedMask, mask, appearance);
_appearance.SetData(uid, WireVisVisuals.ConnectedMask, mask);
}
}
}
}
16 changes: 8 additions & 8 deletions Content.Server/Power/EntitySystems/ChargerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using JetBrains.Annotations;
using Robust.Shared.Containers;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Storage.Components;
using Robust.Server.Containers;

Expand Down Expand Up @@ -179,7 +178,7 @@ private CellChargerStatus GetStatus(EntityUid uid, ChargerComponent component)
if (container.ContainedEntities.Count == 0)
return CellChargerStatus.Empty;

if (!SearchForBattery(container.ContainedEntities.First(), out var heldBattery))
if (!SearchForBattery(container.ContainedEntities[0], out _, out var heldBattery))
return CellChargerStatus.Off;

if (Math.Abs(heldBattery.MaxCharge - heldBattery.CurrentCharge) < 0.01)
Expand All @@ -199,27 +198,28 @@ private void TransferPower(EntityUid uid, EntityUid targetEntity, ChargerCompone
if (component.Whitelist?.IsValid(targetEntity, EntityManager) == false)
return;

if (!SearchForBattery(targetEntity, out var heldBattery))
if (!SearchForBattery(targetEntity, out var batteryUid, out var heldBattery))
return;

_battery.SetCharge(targetEntity, heldBattery.CurrentCharge + component.ChargeRate * frameTime, heldBattery);
_battery.SetCharge(batteryUid.Value, heldBattery.CurrentCharge + component.ChargeRate * frameTime, heldBattery);
// Just so the sprite won't be set to 99.99999% visibility
if (heldBattery.MaxCharge - heldBattery.CurrentCharge < 0.01)
{
_battery.SetCharge(targetEntity, heldBattery.MaxCharge, heldBattery);
_battery.SetCharge(batteryUid.Value, heldBattery.MaxCharge, heldBattery);
}

UpdateStatus(uid, component);
}

private bool SearchForBattery(EntityUid uid, [NotNullWhen(true)] out BatteryComponent? component)
private bool SearchForBattery(EntityUid uid, [NotNullWhen(true)] out EntityUid? batteryUid, [NotNullWhen(true)] out BatteryComponent? component)
{
// try get a battery directly on the inserted entity
if (!TryComp(uid, out component))
{
// or by checking for a power cell slot on the inserted entity
return _powerCell.TryGetBatteryFromSlot(uid, out component);
return _powerCell.TryGetBatteryFromSlot(uid, out batteryUid, out component);
}
batteryUid = uid;
return true;
}
}
}
5 changes: 1 addition & 4 deletions Content.Server/Power/EntitySystems/ExtensionCableSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Server.Power.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
Expand All @@ -9,8 +8,6 @@ namespace Content.Server.Power.EntitySystems
{
public sealed class ExtensionCableSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -362,4 +359,4 @@ public ReceiverDisconnectedEvent(Entity<ExtensionCableReceiverComponent> receive

#endregion
}
}
}
19 changes: 12 additions & 7 deletions Content.Server/Power/EntitySystems/PowerReceiverSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public sealed class PowerReceiverSystem : EntitySystem
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly AudioSystem _audio = default!;
private EntityQuery<ApcPowerReceiverComponent> _recQuery;
private EntityQuery<ApcPowerProviderComponent> _provQuery;

public override void Initialize()
{
Expand All @@ -35,6 +37,9 @@ public override void Initialize()

SubscribeLocalEvent<ApcPowerReceiverComponent, GetVerbsEvent<Verb>>(OnGetVerbs);
SubscribeLocalEvent<PowerSwitchComponent, GetVerbsEvent<AlternativeVerb>>(AddSwitchPowerVerb);

_recQuery = GetEntityQuery<ApcPowerReceiverComponent>();
_provQuery = GetEntityQuery<ApcPowerProviderComponent>();
}

private void OnGetVerbs(EntityUid uid, ApcPowerReceiverComponent component, GetVerbsEvent<Verb> args)
Expand Down Expand Up @@ -77,7 +82,7 @@ private void OnProviderShutdown(EntityUid uid, ApcPowerProviderComponent compone
private void OnProviderConnected(Entity<ApcPowerReceiverComponent> receiver, ref ExtensionCableSystem.ProviderConnectedEvent args)
{
var providerUid = args.Provider.Owner;
if (!EntityManager.TryGetComponent<ApcPowerProviderComponent>(providerUid, out var provider))
if (!_provQuery.TryGetComponent(providerUid, out var provider))
return;

receiver.Comp.Provider = provider;
Expand All @@ -94,15 +99,15 @@ private void OnProviderDisconnected(Entity<ApcPowerReceiverComponent> receiver,

private void OnReceiverConnected(Entity<ApcPowerProviderComponent> provider, ref ExtensionCableSystem.ReceiverConnectedEvent args)
{
if (EntityManager.TryGetComponent(args.Receiver, out ApcPowerReceiverComponent? receiver))
if (_recQuery.TryGetComponent(args.Receiver, out var receiver))
{
provider.Comp.AddReceiver(receiver);
}
}

private void OnReceiverDisconnected(EntityUid uid, ApcPowerProviderComponent provider, ExtensionCableSystem.ReceiverDisconnectedEvent args)
{
if (EntityManager.TryGetComponent(args.Receiver, out ApcPowerReceiverComponent? receiver))
if (_recQuery.TryGetComponent(args.Receiver, out var receiver))
{
provider.RemoveReceiver(receiver);
}
Expand All @@ -116,7 +121,7 @@ private void AddSwitchPowerVerb(EntityUid uid, PowerSwitchComponent component, G
if (!HasComp<HandsComponent>(args.User))
return;

if (!TryComp<ApcPowerReceiverComponent>(uid, out var receiver))
if (!_recQuery.TryGetComponent(uid, out var receiver))
return;

if (!receiver.NeedsPower)
Expand Down Expand Up @@ -152,7 +157,7 @@ private void ProviderChanged(Entity<ApcPowerReceiverComponent> receiver)
/// </summary>
public bool IsPowered(EntityUid uid, ApcPowerReceiverComponent? receiver = null)
{
if (!Resolve(uid, ref receiver, false))
if (!_recQuery.Resolve(uid, ref receiver, false))
return true;

return receiver.Powered;
Expand All @@ -164,7 +169,7 @@ public bool IsPowered(EntityUid uid, ApcPowerReceiverComponent? receiver = null)
/// </summary>
public bool TogglePower(EntityUid uid, bool playSwitchSound = true, ApcPowerReceiverComponent? receiver = null, EntityUid? user = null)
{
if (!Resolve(uid, ref receiver, false))
if (!_recQuery.Resolve(uid, ref receiver, false))
return true;

// it'll save a lot of confusion if 'always powered' means 'always powered'
Expand All @@ -188,4 +193,4 @@ public bool TogglePower(EntityUid uid, bool playSwitchSound = true, ApcPowerRece
return !receiver.PowerDisabled; // i.e. PowerEnabled
}
}
}
}
11 changes: 8 additions & 3 deletions Content.Server/Power/Generation/Teg/TegNodeGroup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.NodeContainer.Nodes;
Expand Down Expand Up @@ -66,11 +66,16 @@ public override void Initialize(Node sourceNode, IEntityManager entMan)

public override void LoadNodes(List<Node> groupNodes)
{
DebugTools.Assert(groupNodes.Count <= 3, "The TEG has at most 3 parts");
DebugTools.Assert(_entityManager != null);

base.LoadNodes(groupNodes);

if (groupNodes.Count > 3)
{
// Somehow got more TEG parts. Probably shenanigans. Bail.
return;
}

Generator = groupNodes.OfType<TegNodeGenerator>().SingleOrDefault();
if (Generator != null)
{
Expand Down Expand Up @@ -203,4 +208,4 @@ public override IEnumerable<Node> GetReachableNodes(
}
}
}
}
}
14 changes: 5 additions & 9 deletions Content.Server/Power/Generator/GasPowerReceiverSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Components;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems;
Expand Down Expand Up @@ -26,18 +26,14 @@ private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component,
{
var timeDelta = args.dt;

if (!HasComp<AtmosDeviceComponent>(uid)
|| !TryComp<NodeContainerComponent>(uid, out var nodeContainer)
|| !_nodeContainer.TryGetNode<PipeNode>(nodeContainer, "pipe", out var pipe))
{
if (!_nodeContainer.TryGetNode(uid, "pipe", out PipeNode? pipe))

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'

Check failure on line 29 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

Argument 1: cannot convert from 'Robust.Shared.GameObjects.EntityUid' to 'Content.Server.NodeContainer.NodeContainerComponent'
return;
}

// if we're below the max temperature, then we are simply consuming our target gas
if (pipe.Air.Temperature <= component.MaxTemperature)

Check failure on line 33 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Dereference of a possibly null reference.

Check failure on line 33 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Dereference of a possibly null reference.

Check failure on line 33 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

Dereference of a possibly null reference.
{
// we have enough gas, so we consume it and are powered
if (pipe.Air.Moles[(int) component.TargetGas] > component.MolesConsumedSec * timeDelta)
if (pipe.Air[(int) component.TargetGas] > component.MolesConsumedSec * timeDelta)

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Cannot apply indexing with

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Cannot apply indexing with

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Cannot apply indexing with

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

Cannot apply indexing with

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

Cannot apply indexing with

Check failure on line 36 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

Cannot apply indexing with
{
pipe.Air.AdjustMoles(component.TargetGas, -component.MolesConsumedSec * timeDelta);
SetPowered(uid, component, true);
Expand All @@ -57,7 +53,7 @@ private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component,
if (component.OffVentGas)
{
// eject the gas into the atmosphere
var mix = _atmosphereSystem.GetContainingMixture(uid, false, true);
var mix = _atmosphereSystem.GetContainingMixture(uid, args.Grid, args.Map, false, true);

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'AtmosDeviceUpdateEvent' does not contain a definition for 'Grid' and no accessible extension method 'Grid' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'AtmosDeviceUpdateEvent' does not contain a definition for 'Map' and no accessible extension method 'Map' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'AtmosDeviceUpdateEvent' does not contain a definition for 'Grid' and no accessible extension method 'Grid' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'AtmosDeviceUpdateEvent' does not contain a definition for 'Map' and no accessible extension method 'Map' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'AtmosDeviceUpdateEvent' does not contain a definition for 'Grid' and no accessible extension method 'Grid' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'AtmosDeviceUpdateEvent' does not contain a definition for 'Map' and no accessible extension method 'Map' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'AtmosDeviceUpdateEvent' does not contain a definition for 'Grid' and no accessible extension method 'Grid' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'AtmosDeviceUpdateEvent' does not contain a definition for 'Grid' and no accessible extension method 'Grid' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 56 in Content.Server/Power/Generator/GasPowerReceiverSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'AtmosDeviceUpdateEvent' does not contain a definition for 'Map' and no accessible extension method 'Map' accepting a first argument of type 'AtmosDeviceUpdateEvent' could be found (are you missing a using directive or an assembly reference?)
if (mix is not null)
_atmosphereSystem.Merge(res, mix);
}
Expand All @@ -80,4 +76,4 @@ private void SetPowered(EntityUid uid, GasPowerReceiverComponent comp, bool stat
RaiseLocalEvent(uid, ref ev);
}
}
}
}
8 changes: 3 additions & 5 deletions Content.Server/Power/Generator/PortableGeneratorSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Content.Server.DoAfter;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.DoAfter;
using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
Expand Down Expand Up @@ -28,7 +27,6 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
[Dependency] private readonly GeneratorSystem _generator = default!;
[Dependency] private readonly PowerSwitchableSystem _switchable = default!;
[Dependency] private readonly ActiveGeneratorRevvingSystem _revving = default!;
[Dependency] private readonly PowerNetSystem _powerNet = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -84,7 +82,7 @@ private void StartGenerator(EntityUid uid, PortableGeneratorComponent component,

_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.StartTime, new GeneratorStartedEvent(), uid, uid)
{
BreakOnDamage = true, BreakOnTargetMove = true, BreakOnUserMove = true, RequireCanInteract = true,
BreakOnDamage = true, BreakOnMove = true, RequireCanInteract = true,

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'DoAfterArgs' does not contain a definition for 'BreakOnMove'

Check failure on line 85 in Content.Server/Power/Generator/PortableGeneratorSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'DoAfterArgs' does not contain a definition for 'BreakOnMove'
NeedHand = true
});
}
Expand Down Expand Up @@ -241,4 +239,4 @@ private void UpdateUI(
GeneratorComponentUiKey.Key,
new PortableGeneratorComponentBuiState(fuelComp, fuel, clogged, networkStats));
}
}
}

0 comments on commit 807452f

Please sign in to comment.