From: Kara Date: Mon, 10 Apr 2023 21:28:27 +0000 (-0700) Subject: [Combat] Let people melee attack themselves (#15272) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4ceb45d17121f6ce4c5b27283261c7a0a1b54d4e;p=space-station-14.git [Combat] Let people melee attack themselves (#15272) --- 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.