From e968fb695bd1a29b35dfa63d8d03198baecddbbe Mon Sep 17 00:00:00 2001 From: HitPanda <104197232+EnefFlow@users.noreply.github.com> Date: Thu, 25 May 2023 21:01:07 +0300 Subject: [PATCH] [Fix] CPR fix (#109) --- Content.Server/Body/Systems/RespiratorSystem.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index c1d1a11a5b..378ce439fc 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -12,7 +12,8 @@ using Content.Shared.Atmos; using Content.Shared.Body.Components; using Content.Shared.Damage; using Content.Shared.Database; -using Content.Shared.DoAfter; // WD +using Content.Shared.DoAfter; +using Content.Shared.Humanoid; // WD using Content.Shared.IdentityManagement; // WD using Content.Shared.Interaction; // WD using Content.Shared.Inventory; // WD @@ -234,10 +235,10 @@ namespace Content.Server.Body.Systems // WD start private void OnHandInteract(EntityUid uid, RespiratorComponent component, InteractHandEvent args) { - args.Handled = true; - if (CanCPR(uid, component, args.User)) DoCPR(uid, component, args.User); + + args.Handled = true; } private bool CanCPR(EntityUid target, RespiratorComponent comp, EntityUid user) @@ -251,10 +252,7 @@ namespace Content.Server.Body.Systems if (comp.CPRPerformedBy != null && comp.CPRPerformedBy != user) return false; - if (!TryComp(target, out var body)) - return false; - - if (body.Prototype?.Id is not ("Human" or "Diona" or "Slime" or "Dwarf" or "Reptilian" or "Skrell" or "Arachnid")) + if (!TryComp(target, out _)) return false; if (!TryComp(target, out MobStateComponent? targetState))