From fa309bb318454c2a41a46ec79e2410cccff57cee Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 11 Feb 2022 08:04:04 +1300 Subject: [PATCH] Fix being able to breathe in crit. (#6629) --- .../Body/Systems/RespiratorSystem.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 5c71f3035a..6218e0ea22 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -61,16 +61,19 @@ namespace Content.Server.Body.Systems respirator.AccumulatedFrametime -= respirator.CycleDelay; UpdateSaturation(respirator.Owner, -respirator.CycleDelay, respirator); - switch (respirator.Status) + if (!state.IsIncapacitated()) // cannot breathe in crit. { - case RespiratorStatus.Inhaling: - Inhale(uid, body); - respirator.Status = RespiratorStatus.Exhaling; - break; - case RespiratorStatus.Exhaling: - Exhale(uid, body); - respirator.Status = RespiratorStatus.Inhaling; - break; + switch (respirator.Status) + { + case RespiratorStatus.Inhaling: + Inhale(uid, body); + respirator.Status = RespiratorStatus.Exhaling; + break; + case RespiratorStatus.Exhaling: + Exhale(uid, body); + respirator.Status = RespiratorStatus.Inhaling; + break; + } } if (respirator.Saturation < respirator.SuffocationThreshold)