add glue logs (#18667)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Item;
|
||||
@@ -5,6 +6,7 @@ using Content.Shared.Glue;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Hands;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.Interaction.Components;
|
||||
@@ -18,6 +20,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -42,7 +45,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryGlue(uid, component, target))
|
||||
if (TryGlue(uid, component, target, args.User))
|
||||
{
|
||||
args.Handled = true;
|
||||
_audio.PlayPvs(component.Squeeze, uid);
|
||||
@@ -54,7 +57,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryGlue(EntityUid uid, GlueComponent component, EntityUid target)
|
||||
private bool TryGlue(EntityUid uid, GlueComponent component, EntityUid target, EntityUid actor)
|
||||
{
|
||||
// if item is glued then don't apply glue again so it can be removed for reasonable time
|
||||
if (HasComp<GluedComponent>(target) || !HasComp<ItemComponent>(target))
|
||||
@@ -68,6 +71,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
||||
if (quantity > 0)
|
||||
{
|
||||
EnsureComp<GluedComponent>(target).Duration = quantity.Double() * component.DurationPerUnit;
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(actor):actor} glued {ToPrettyString(target):subject} with {ToPrettyString(uid):tool}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user