From c1578ea4a70f4d5a7db66c0d47b53ad088d6888d Mon Sep 17 00:00:00 2001 From: Mervill Date: Fri, 16 Sep 2022 14:34:17 -0700 Subject: [PATCH] Setting the side port output on a gas mixer now behaves as intended (#11363) --- Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs b/Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs index 2cd140ef55..aca4835bf2 100644 --- a/Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs +++ b/Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs @@ -1,4 +1,4 @@ -using System; +using System; using Content.Client.Atmos.EntitySystems; using Content.Shared.Atmos; using Content.Shared.Atmos.Piping.Binary.Components; @@ -57,10 +57,12 @@ namespace Content.Client.Atmos.UI private void OnMixerSetPercentagePressed(string value) { - // We don't need to send both nodes because it's just 1.0f - node + // We don't need to send both nodes because it's just 100.0f - node float node = float.TryParse(value, out var parsed) ? parsed : 1.0f; - if(_window is not null) node = _window.NodeOneLastEdited ? node : 1.0f - node; + node = Math.Clamp(node, 0, 100); + + if (_window is not null) node = _window.NodeOneLastEdited ? node : 100.0f - node; SendMessage(new GasMixerChangeNodePercentageMessage(node)); }