Stop healing when target is dead (#7224)

This commit is contained in:
mirrorcult
2022-04-16 23:29:31 -07:00
committed by GitHub
parent 2b9349841c
commit b311c9e2c9

View File

@@ -9,6 +9,7 @@ using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.MobState.Components;
using Content.Shared.Stacks;
using Robust.Shared.Audio;
using Robust.Shared.Player;
@@ -35,6 +36,9 @@ public sealed class HealingSystem : EntitySystem
private void OnHealingComplete(EntityUid uid, DamageableComponent component, HealingCompleteEvent args)
{
if (TryComp<MobStateComponent>(uid, out var state) && state.IsDead())
return;
if (TryComp<StackComponent>(args.Component.Owner, out var stack) && stack.Count < 1) return;
if (component.DamageContainerID is not null &&
@@ -95,6 +99,9 @@ public sealed class HealingSystem : EntitySystem
return;
}
if (TryComp<MobStateComponent>(target, out var state) && state.IsDead())
return;
if (!TryComp<DamageableComponent>(target, out var targetDamage))
return;