diff --git a/Content.Server/Forensics/Systems/ForensicsSystem.cs b/Content.Server/Forensics/Systems/ForensicsSystem.cs index fefe59af0bdb..cd4e2edaecae 100644 --- a/Content.Server/Forensics/Systems/ForensicsSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicsSystem.cs @@ -41,8 +41,7 @@ public override void Initialize() private void OnInteract(EntityUid uid, FingerprintComponent component, ContactInteractionEvent args) { - if(args.HandContact) - ApplyEvidence(uid, args.Other); + ApplyEvidence(uid, args.Other); } private void OnFingerprintInit(EntityUid uid, FingerprintComponent component, MapInitEvent args) diff --git a/Content.Shared/Interaction/Events/ContactInteractionEvent.cs b/Content.Shared/Interaction/Events/ContactInteractionEvent.cs index 479bcef01654..c9d5fba2ed0b 100644 --- a/Content.Shared/Interaction/Events/ContactInteractionEvent.cs +++ b/Content.Shared/Interaction/Events/ContactInteractionEvent.cs @@ -9,11 +9,9 @@ namespace Content.Shared.Interaction.Events; public sealed class ContactInteractionEvent : HandledEntityEventArgs { public readonly EntityUid Other; - public bool HandContact; - public ContactInteractionEvent(EntityUid other, bool handContact = false) + public ContactInteractionEvent(EntityUid other) { Other = other; - HandContact = handContact; } } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 5ccf8d3c4d0d..aca078687a84 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -468,7 +468,7 @@ public void InteractHand(EntityUid user, EntityUid target) var message = new InteractHandEvent(user, target); RaiseLocalEvent(target, message, true); _adminLogger.Add(LogType.InteractHand, LogImpact.Low, $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target}"); - DoContactInteraction(user, target, message, true); + DoContactInteraction(user, target, message); if (message.Handled) return; @@ -952,7 +952,7 @@ public void InteractUsing( RaiseLocalEvent(target, interactUsingEvent, true); DoContactInteraction(user, used, interactUsingEvent); DoContactInteraction(user, target, interactUsingEvent); - DoContactInteraction(used, target, interactUsingEvent); + // Contact interactions are currently only used for forensics, so we don't raise used -> target if (interactUsingEvent.Handled) return; @@ -973,7 +973,7 @@ public void InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, E if (canReach) { DoContactInteraction(user, target, afterInteractEvent); - DoContactInteraction(used, target, afterInteractEvent); + // Contact interactions are currently only used for forensics, so we don't raise used -> target } if (afterInteractEvent.Handled) @@ -989,7 +989,7 @@ public void InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, E if (canReach) { DoContactInteraction(user, target, afterInteractUsingEvent); - DoContactInteraction(used, target, afterInteractUsingEvent); + // Contact interactions are currently only used for forensics, so we don't raise used -> target } } @@ -1047,7 +1047,7 @@ public bool InteractionActivate( if (!activateMsg.Handled && !userEv.Handled) return false; - DoContactInteraction(user, used, activateMsg, true); + DoContactInteraction(user, used, activateMsg); // Still need to call this even without checkUseDelay in case this gets relayed from Activate. if (delayComponent != null) _useDelay.TryResetDelay(used, component: delayComponent); @@ -1253,7 +1253,7 @@ protected bool ValidateClientInput(ICommonSession? session, EntityCoordinates co /// /// Simple convenience function to raise contact events (disease, forensics, etc). /// - public void DoContactInteraction(EntityUid uidA, EntityUid? uidB, HandledEntityEventArgs? args = null, bool handContact = false) + public void DoContactInteraction(EntityUid uidA, EntityUid? uidB, HandledEntityEventArgs? args = null) { if (uidB == null || args?.Handled == false) return; @@ -1265,7 +1265,7 @@ public void DoContactInteraction(EntityUid uidA, EntityUid? uidB, HandledEntityE if (Paused(uidA) || Paused(uidB.Value)) return; - RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value, handContact)); + RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value)); RaiseLocalEvent(uidB.Value, new ContactInteractionEvent(uidA)); } diff --git a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs index 174e99bcd184..557c316e26de 100644 --- a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs +++ b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs @@ -437,7 +437,7 @@ public bool TryStartPull(EntityUid pullerUid, EntityUid pullableUid, // Pulling confirmed - _interaction.DoContactInteraction(pullerUid, pullableUid, handContact: true); + _interaction.DoContactInteraction(pullableUid, pullerUid); // Use net entity so it's consistent across client and server. pullableComp.PullJointId = $"pull-joint-{GetNetEntity(pullableUid)}"; diff --git a/Content.Shared/Verbs/SharedVerbSystem.cs b/Content.Shared/Verbs/SharedVerbSystem.cs index 6f811a3457a1..319f927c7b3d 100644 --- a/Content.Shared/Verbs/SharedVerbSystem.cs +++ b/Content.Shared/Verbs/SharedVerbSystem.cs @@ -170,7 +170,7 @@ public virtual void ExecuteVerb(Verb verb, EntityUid user, EntityUid target, boo // Perform any contact interactions if (verb.DoContactInteraction ?? (verb.DefaultDoContactInteraction && _interactionSystem.InRangeUnobstructed(user, target))) - _interactionSystem.DoContactInteraction(user, target, handContact: true); + _interactionSystem.DoContactInteraction(user, target); } } } diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index ae13619497ee..72cf4ec550a7 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -485,12 +485,12 @@ protected virtual void DoLightAttack(EntityUid user, LightAttackEvent ev, Entity var weapon = GetEntity(ev.Weapon); - Interaction.DoContactInteraction(weapon, target, handContact: user == weapon); - Interaction.DoContactInteraction(user, weapon, handContact: true); + // We skip weapon -> target interaction, as forensics system applies DNA on hit + Interaction.DoContactInteraction(user, weapon); // If the user is using a long-range weapon, this probably shouldn't be happening? But I'll interpret melee as a // somewhat messy scuffle. See also, heavy attacks. - Interaction.DoContactInteraction(user, target, handContact: user == weapon); + Interaction.DoContactInteraction(user, target); // For stuff that cares about it being attacked. var attackedEvent = new AttackedEvent(meleeUid, user, targetXform.Coordinates); @@ -611,16 +611,16 @@ private bool DoHeavyAttack(EntityUid user, HeavyAttackEvent ev, EntityUid meleeU var weapon = GetEntity(ev.Weapon); - Interaction.DoContactInteraction(user, weapon, handContact: true); + Interaction.DoContactInteraction(user, weapon); // For stuff that cares about it being attacked. foreach (var target in targets) { - Interaction.DoContactInteraction(weapon, target, handContact: user == weapon); + // We skip weapon -> target interaction, as forensics system applies DNA on hit // If the user is using a long-range weapon, this probably shouldn't be happening? But I'll interpret melee as a // somewhat messy scuffle. See also, light attacks. - Interaction.DoContactInteraction(user, target, handContact: user == weapon); + Interaction.DoContactInteraction(user, target); } var appliedDamage = new DamageSpecifier();