diff --git a/Content.Client/Chat/SpeechBubble.cs b/Content.Client/Chat/SpeechBubble.cs index 147c3a8d5a..715715d9a1 100644 --- a/Content.Client/Chat/SpeechBubble.cs +++ b/Content.Client/Chat/SpeechBubble.cs @@ -122,7 +122,7 @@ namespace Content.Client.Chat var screenPos = lowerCenter - (Width / 2, ContentHeight + _verticalOffsetAchieved); LayoutContainer.SetPosition(this, screenPos); - var height = (lowerCenter.Y - screenPos.Y).Clamp(0, ContentHeight); + var height = FloatMath.Clamp(lowerCenter.Y - screenPos.Y, 0, ContentHeight); LayoutContainer.SetSize(this, (Size.X, height)); } diff --git a/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs b/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs index 8a6e1667e2..f44166c11f 100644 --- a/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/MagicMirrorBoundUserInterface.cs @@ -244,7 +244,7 @@ namespace Content.Client.GameObjects.Components if (int.TryParse(ev.Text, out var result)) { - result = result.Clamp(0, byte.MaxValue); + result = FloatMath.Clamp(result, 0, byte.MaxValue); _ignoreEvents = true; _colorValue = (byte) result; diff --git a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs index 68925253c4..926e6a5c46 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs @@ -152,7 +152,7 @@ namespace Content.Client.GameObjects.Components.Mobs var progress = (_gameTiming.CurTime - start).TotalSeconds / length; var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5); - cooldownGraphic.Progress = (float)ratio.Clamp(-1, 1); + cooldownGraphic.Progress = FloatMath.Clamp((float)ratio, -1, 1); cooldownGraphic.Visible = ratio > -1f; } } diff --git a/Content.Client/UserInterface/ItemSlotManager.cs b/Content.Client/UserInterface/ItemSlotManager.cs index ff8872553d..2186d4e4ee 100644 --- a/Content.Client/UserInterface/ItemSlotManager.cs +++ b/Content.Client/UserInterface/ItemSlotManager.cs @@ -112,7 +112,7 @@ namespace Content.Client.UserInterface var progress = (_gameTiming.CurTime - start).TotalSeconds / length; var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5); - cooldownDisplay.Progress = (float)ratio.Clamp(-1, 1); + cooldownDisplay.Progress = FloatMath.Clamp((float)ratio, -1, 1); if (ratio > -1f) { diff --git a/Content.Server/Preferences/PreferencesDatabase.cs b/Content.Server/Preferences/PreferencesDatabase.cs index 6c6c4719d0..8f13a1324e 100644 --- a/Content.Server/Preferences/PreferencesDatabase.cs +++ b/Content.Server/Preferences/PreferencesDatabase.cs @@ -60,7 +60,7 @@ namespace Content.Server.Preferences await _prefsSemaphore.WaitAsync(); try { - index = index.Clamp(0, _maxCharacterSlots - 1); + index = FloatMath.Clamp(index, 0, _maxCharacterSlots - 1); await _prefsDb.SaveSelectedCharacterIndex(username, index); } finally