From 4ceb45d17121f6ce4c5b27283261c7a0a1b54d4e Mon Sep 17 00:00:00 2001 From: Kara Date: Mon, 10 Apr 2023 14:28:27 -0700 Subject: [PATCH] [Combat] Let people melee attack themselves (#15272) --- Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index bd3fa842b4..a2334ba73e 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -418,10 +418,8 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem { var damage = component.Damage * GetModifier(component, true); - // Can't attack yourself // For consistency with wide attacks stuff needs damageable. - if (user == ev.Target || - Deleted(ev.Target) || + if (Deleted(ev.Target) || !HasComp(ev.Target) || !TryComp(ev.Target, out var targetXform) || // Not in LOS.