From df8250bbc9ca3cce68180d3ec9a1daafe6111c6e Mon Sep 17 00:00:00 2001
From: Trest <144359854+trest100@users.noreply.github.com>
Date: Tue, 10 Dec 2024 06:32:37 +0300
Subject: [PATCH] fonarik
---
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 8379e930995..ed423c0046f 100644
--- a/Content.Shared/CombatMode/CombatModeComponent.cs
+++ b/Content.Shared/CombatMode/CombatModeComponent.cs
@@ -51,5 +51,19 @@ public sealed partial class CombatModeComponent : Component
///
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;
+
+ // BACKMEN 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;
+ // BACKMEN END
}
}
diff --git a/Content.Shared/CombatMode/SharedCombatModeSystem.cs b/Content.Shared/CombatMode/SharedCombatModeSystem.cs
index e08b7f1d7e8..331ebc55a94 100644
--- a/Content.Shared/CombatMode/SharedCombatModeSystem.cs
+++ b/Content.Shared/CombatMode/SharedCombatModeSystem.cs
@@ -104,7 +104,14 @@ private void SetMouseRotatorComponents(EntityUid uid, bool value)
{
if (value)
{
- EnsureComp(uid);
+ var rot = EnsureComp(uid);
+ // BACKMEN EDIT 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;
+ }
+ // BACKMEN EDIT END
EnsureComp(uid);
}
else