From 45b803ce411b5ba25c7b14052463877853009559 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 21 Mar 2019 17:51:25 +0100 Subject: [PATCH] Simplify Healing Component deletion. I just fixed the bug causing it to need explicit dropping so this hack can go. --- .../Components/Healing/HealingComponent.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs index 1e6fd58f0c..72b69f3b47 100644 --- a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs +++ b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs @@ -37,7 +37,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee if (attacked.TryGetComponent(out DamageableComponent damagecomponent)) { damagecomponent.TakeHealing(DamageType.Brute, Heal); - DropAndDelete(user); + Owner.Delete(); } } @@ -46,19 +46,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee if (user.TryGetComponent(out DamageableComponent damagecomponent)) { damagecomponent.TakeHealing(DamageType.Brute, Heal); - DropAndDelete(user); + Owner.Delete(); return false; } return false; } - - void DropAndDelete(IEntity user) - { - if(user.TryGetComponent(out HandsComponent handscomponent)) - { - handscomponent.Drop(Owner); - Owner.Delete(); - } - } } }