From 2e04efadcc9c87af2fa5953f78985271f94b12c7 Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Sat, 7 Dec 2024 07:31:01 +0100 Subject: [PATCH] NoScope 360 AWP kill --- Content.Shared/CombatMode/CombatModeComponent.cs | 14 ++++++++++++++ .../CombatMode/SharedCombatModeSystem.cs | 9 ++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Content.Shared/CombatMode/CombatModeComponent.cs b/Content.Shared/CombatMode/CombatModeComponent.cs index 124a682d5c7..b26830ad580 100644 --- a/Content.Shared/CombatMode/CombatModeComponent.cs +++ b/Content.Shared/CombatMode/CombatModeComponent.cs @@ -48,5 +48,19 @@ public sealed partial class CombatModeComponent : Component /// [DataField, AutoNetworkedField] public bool ToggleMouseRotator = true; + + // Corvax-Next-NoScope-Start + /// + /// If true, sets to 1 degree and + /// to false when the owner enters combatmode. This is currently being tested as of 06.12.24, + /// so a simple bool switch should suffice. + /// Leaving AutoNetworking just in case shitmins need to disable it for someone. Will only take effect when re-enabling combat mode. + /// + /// + /// No effect if is false. + /// + [DataField, AutoNetworkedField] + public bool SmoothRotation = true; + // Corvax-Next-NoScope-End } } diff --git a/Content.Shared/CombatMode/SharedCombatModeSystem.cs b/Content.Shared/CombatMode/SharedCombatModeSystem.cs index 5eed8ee2423..486694a9f36 100644 --- a/Content.Shared/CombatMode/SharedCombatModeSystem.cs +++ b/Content.Shared/CombatMode/SharedCombatModeSystem.cs @@ -94,7 +94,14 @@ private void SetMouseRotatorComponents(EntityUid uid, bool value) { if (value) { - EnsureComp(uid); + var rot = EnsureComp(uid); // Corvax-Next-NoScope + // Corvax-Next-NoScope-Start + if (TryComp(uid, out var comp) && comp.SmoothRotation) // no idea under which (intended) circumstances this can fail (if any), so i'll avoid Comp<>(). + { + rot.AngleTolerance = Angle.FromDegrees(1); // arbitrary + rot.Simple4DirMode = false; + } + // Corvax-Next-NoScope-End EnsureComp(uid); } else