]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Handheld Crew Monitor and Station Map use power (#15983)
authorthemias <89101928+themias@users.noreply.github.com>
Fri, 5 May 2023 17:52:40 +0000 (13:52 -0400)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 17:52:40 +0000 (10:52 -0700)
Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs
Content.Server/Pinpointer/StationMapSystem.cs

index 034f0e7e8adcab347ffef45888985c171f2d07a0..f2e59f9773be2b22c7dfe6d9369d3c12feb8465b 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Medical.CrewMonitoring;
 using Robust.Shared.Map;
 using Content.Shared.Medical.SuitSensor;
 using Robust.Shared.Timing;
+using Content.Server.PowerCell;
 
 namespace Content.Server.Medical.CrewMonitoring
 {
@@ -16,6 +17,7 @@ namespace Content.Server.Medical.CrewMonitoring
         [Dependency] private readonly SharedTransformSystem _xform = default!;
         [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly IMapManager _mapManager = default!;
+        [Dependency] private readonly PowerCellSystem _cell = default!;
 
         public override void Initialize()
         {
@@ -47,6 +49,9 @@ namespace Content.Server.Medical.CrewMonitoring
 
         private void OnUIOpened(EntityUid uid, CrewMonitoringConsoleComponent component, BoundUIOpenedEvent args)
         {
+            if (!_cell.TryUseActivatableCharge(uid))
+                return;
+
             UpdateUserInterface(uid, component);
         }
 
index c0dbbc641fe904b3e10e7f79a469f3afe0e8fa99..daf9df25ba8f452ed55cc9108beee9051f4b44b0 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Server.PowerCell;
 using Content.Shared.Pinpointer;
 using Robust.Server.GameObjects;
 
@@ -6,6 +7,7 @@ namespace Content.Server.Pinpointer;
 public sealed class StationMapSystem : EntitySystem
 {
     [Dependency] private readonly UserInterfaceSystem _ui = default!;
+    [Dependency] private readonly PowerCellSystem _cell = default!;
 
     public override void Initialize()
     {
@@ -36,6 +38,9 @@ public sealed class StationMapSystem : EntitySystem
         if (args.Session.AttachedEntity == null)
             return;
 
+        if (!_cell.TryUseActivatableCharge(uid))
+            return;
+
         var comp = EnsureComp<StationMapUserComponent>(args.Session.AttachedEntity.Value);
         comp.Map = uid;
     }