[Combat] Let people melee attack themselves (#15272)

This commit is contained in:
Kara
2023-04-10 14:28:27 -07:00
committed by GitHub
parent f796933b9e
commit 4ceb45d171

View File

@@ -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<DamageableComponent>(ev.Target) ||
!TryComp<TransformComponent>(ev.Target, out var targetXform) ||
// Not in LOS.