]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add admin logs to Rehydration comp. (#30597)
authorRepo <47093363+Titian3@users.noreply.github.com>
Fri, 9 Aug 2024 06:24:19 +0000 (18:24 +1200)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2024 06:24:19 +0000 (16:24 +1000)
Content.Shared/Chemistry/EntitySystems/RehydratableSystem.cs

index 36ca791290a2c7957c0e74ddef3cde3d1611c35f..0f5d51057f22c4cd1e7016daba03bc71d5d7540a 100644 (file)
@@ -1,4 +1,6 @@
+using Content.Shared.Administration.Logs;
 using Content.Shared.Chemistry.Components;
+using Content.Shared.Database;
 using Content.Shared.FixedPoint;
 using Content.Shared.Popups;
 using Robust.Shared.Network;
@@ -13,6 +15,7 @@ public sealed class RehydratableSystem : EntitySystem
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly SharedSolutionContainerSystem _solutions = default!;
     [Dependency] private readonly SharedTransformSystem _xform = default!;
+    [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
 
     public override void Initialize()
     {
@@ -24,6 +27,7 @@ public sealed class RehydratableSystem : EntitySystem
     private void OnSolutionChange(Entity<RehydratableComponent> ent, ref SolutionContainerChangedEvent args)
     {
         var quantity = _solutions.GetTotalPrototypeQuantity(ent, ent.Comp.CatalystPrototype);
+        _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(ent.Owner)} was hydrated, now contains a solution of: {SharedSolutionContainerSystem.ToPrettyString(args.Solution)}.");
         if (quantity != FixedPoint2.Zero && quantity >= ent.Comp.CatalystMinimum)
         {
             Expand(ent);
@@ -41,6 +45,8 @@ public sealed class RehydratableSystem : EntitySystem
         var randomMob = _random.Pick(comp.PossibleSpawns);
 
         var target = Spawn(randomMob, Transform(uid).Coordinates);
+        _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(ent.Owner)} has been hydrated correctly and spawned: {ToPrettyString(target)}.");
+
         _popup.PopupEntity(Loc.GetString("rehydratable-component-expands-message", ("owner", uid)), target);
 
         _xform.AttachToGridOrMap(target);