From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Thu, 1 Aug 2024 02:29:02 +0000 (-0700) Subject: Update RespiratorSystem.cs to not use Component.Owner (#30426) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ba1610012a1f5e4fd6f9330aed91535176fb51ad;p=space-station-14.git Update RespiratorSystem.cs to not use Component.Owner (#30426) Update RespiratorSystem.cs Co-authored-by: plykiya --- diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 5fbd0c4814..5190ba37d5 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -114,7 +114,7 @@ public sealed class RespiratorSystem : EntitySystem if (!Resolve(uid, ref body, logMissing: false)) return; - var organs = _bodySystem.GetBodyOrganComponents(uid, body); + var organs = _bodySystem.GetBodyOrganEntityComps((uid, body)); // Inhale gas var ev = new InhaleLocationEvent(); @@ -131,11 +131,11 @@ public sealed class RespiratorSystem : EntitySystem var lungRatio = 1.0f / organs.Count; var gas = organs.Count == 1 ? actualGas : actualGas.RemoveRatio(lungRatio); - foreach (var (lung, _) in organs) + foreach (var (organUid, lung, _) in organs) { // Merge doesn't remove gas from the giver. _atmosSys.Merge(lung.Air, gas); - _lungSystem.GasToReagent(lung.Owner, lung); + _lungSystem.GasToReagent(organUid, lung); } } @@ -144,7 +144,7 @@ public sealed class RespiratorSystem : EntitySystem if (!Resolve(uid, ref body, logMissing: false)) return; - var organs = _bodySystem.GetBodyOrganComponents(uid, body); + var organs = _bodySystem.GetBodyOrganEntityComps((uid, body)); // exhale gas @@ -161,12 +161,12 @@ public sealed class RespiratorSystem : EntitySystem } var outGas = new GasMixture(ev.Gas.Volume); - foreach (var (lung, _) in organs) + foreach (var (organUid, lung, _) in organs) { _atmosSys.Merge(outGas, lung.Air); lung.Air.Clear(); - if (_solutionContainerSystem.ResolveSolution(lung.Owner, lung.SolutionName, ref lung.Solution)) + if (_solutionContainerSystem.ResolveSolution(organUid, lung.SolutionName, ref lung.Solution)) _solutionContainerSystem.RemoveAllSolution(lung.Solution.Value); } @@ -201,7 +201,7 @@ public sealed class RespiratorSystem : EntitySystem if (!Resolve(ent, ref ent.Comp)) return false; - var organs = _bodySystem.GetBodyOrganComponents(ent); + var organs = _bodySystem.GetBodyOrganEntityComps((ent, null)); if (organs.Count == 0) return false; @@ -213,7 +213,7 @@ public sealed class RespiratorSystem : EntitySystem float saturation = 0; foreach (var organ in organs) { - saturation += GetSaturation(solution, organ.Comp.Owner, out var toxic); + saturation += GetSaturation(solution, organ.Owner, out var toxic); if (toxic) return false; }