From bde64856855469ed8ce7bde726238348481cfa7f Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 14 Aug 2024 00:01:04 -0400 Subject: [PATCH] Update ForensicsSystem.cs --- .../Forensics/Systems/ForensicsSystem.cs | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Content.Server/Forensics/Systems/ForensicsSystem.cs b/Content.Server/Forensics/Systems/ForensicsSystem.cs index 7b95ab23434..dff134a5113 100644 --- a/Content.Server/Forensics/Systems/ForensicsSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicsSystem.cs @@ -135,30 +135,30 @@ private void OnAfterInteract(EntityUid uid, CleansForensicsComponent component, return; if (TryComp(args.Target, out var forensicsComp) - && (forensicsComp.DNAs.Count > 0 && forensicsComp.CanDnaBeCleaned) - || (forensicsComp.Fingerprints.Count + forensicsComp.Fibers.Count > 0) - || (forensicsComp.Scent != string.Empty)) + && forensicsComp.DNAs.Count > 0 && forensicsComp.CanDnaBeCleaned + && forensicsComp.Fingerprints.Count + forensicsComp.Fibers.Count > 0 + && forensicsComp.Scent != string.Empty) + { + var cleanDelay = component.CleanDelay; + if (HasComp(args.Target)) + cleanDelay += 30; + + var doAfterArgs = new DoAfterArgs(EntityManager, args.User, cleanDelay, new CleanForensicsDoAfterEvent(), uid, target: args.Target, used: args.Used) { - var cleanDelay = component.CleanDelay; - if (HasComp(args.Target)) - cleanDelay += 30; + BreakOnHandChange = true, + NeedHand = true, + BreakOnDamage = true, + BreakOnTargetMove = true, + MovementThreshold = 0.01f, + DistanceThreshold = forensicsComp.CleanDistance, + }; - var doAfterArgs = new DoAfterArgs(EntityManager, args.User, cleanDelay, new CleanForensicsDoAfterEvent(), uid, target: args.Target, used: args.Used) - { - BreakOnHandChange = true, - NeedHand = true, - BreakOnDamage = true, - BreakOnTargetMove = true, - MovementThreshold = 0.01f, - DistanceThreshold = forensicsComp.CleanDistance, - }; - - _doAfterSystem.TryStartDoAfter(doAfterArgs); - _popupSystem.PopupEntity(Loc.GetString("forensics-cleaning", ("target", args.Target)), args.User, args.User); - - args.Handled = true; - return; - } + _doAfterSystem.TryStartDoAfter(doAfterArgs); + _popupSystem.PopupEntity(Loc.GetString("forensics-cleaning", ("target", args.Target)), args.User, args.User); + + args.Handled = true; + return; + } if (TryComp(args.Target, out var scentComp)) { @@ -211,16 +211,16 @@ private void OnCleanForensicsDoAfter(EntityUid uid, ForensicsComponent component if (args.Target is { Valid: true } target && _inventory.TryGetSlots(target, out var slotDefinitions)) - foreach (var slot in slotDefinitions) - { - if (!_inventory.TryGetSlotEntity(target, slot.Name, out var slotEnt)) - continue; + foreach (var slot in slotDefinitions) + { + if (!_inventory.TryGetSlotEntity(target, slot.Name, out var slotEnt)) + continue; - EnsureComp(slotEnt.Value, out var recipientComp); - recipientComp.Scent = generatedscent; + EnsureComp(slotEnt.Value, out var recipientComp); + recipientComp.Scent = generatedscent; - Dirty(slotEnt.Value, recipientComp); - } + Dirty(slotEnt.Value, recipientComp); + } } if (args.Target is { Valid: true } targetuid)