diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index ce36d4814a..ef2cf24729 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -119,7 +119,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee } } - if(!OnHitEntities(hitEntities, eventArgs)) return true; + if(!OnHitEntities(hitEntities, eventArgs)) return false; if (Arc != null) { @@ -161,7 +161,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee else { audioSystem.PlayFromEntity(_missSound, eventArgs.User); - return true; + return false; } if (target.TryGetComponent(out IDamageableComponent damageComponent)) @@ -172,7 +172,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee var targets = new[] {target}; if (!OnHitEntities(targets, eventArgs)) - return true; + return false; if (ClickArc != null) { diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs index 48bf6a3e5a..0a1a310405 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAttack.cs @@ -26,12 +26,16 @@ namespace Content.Shared.Interfaces.GameObjects.Components ClickLocation = clickLocation; WideAttack = wideAttack; Target = target; + + IEntity? targetEntity = null; + IoCManager.Resolve()?.TryGetEntity(Target, out targetEntity); + TargetEntity = targetEntity; } public IEntity User { get; } public GridCoordinates ClickLocation { get; } public bool WideAttack { get; } public EntityUid Target { get; } - public IEntity? TargetEntity => Target.IsValid() ? IoCManager.Resolve()?.GetEntity(Target) ?? null : null; + public IEntity? TargetEntity { get; } } }