Skip to content

Commit

Permalink
NoScope 360 AWP kill
Browse files Browse the repository at this point in the history
  • Loading branch information
AwareFoxy committed Dec 7, 2024
1 parent 82fdd47 commit 2e04efa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Content.Shared/CombatMode/CombatModeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,19 @@ public sealed partial class CombatModeComponent : Component
/// </summary>
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;

// Corvax-Next-NoScope-Start
/// <summary>
/// If true, sets <see cref="MouseRotatorComponent.AngleTolerance"/> to 1 degree and <see cref="MouseRotatorComponent.Simple4DirMode"/>
/// 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.
/// </summary>
/// <remarks>
/// No effect if <see cref="ToggleMouseRotator"/> is false.
/// </remarks>
[DataField, AutoNetworkedField]
public bool SmoothRotation = true;
// Corvax-Next-NoScope-End
}
}
9 changes: 8 additions & 1 deletion Content.Shared/CombatMode/SharedCombatModeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ private void SetMouseRotatorComponents(EntityUid uid, bool value)
{
if (value)
{
EnsureComp<MouseRotatorComponent>(uid);
var rot = EnsureComp<MouseRotatorComponent>(uid); // Corvax-Next-NoScope
// Corvax-Next-NoScope-Start
if (TryComp<CombatModeComponent>(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<NoRotateOnMoveComponent>(uid);
}
else
Expand Down

0 comments on commit 2e04efa

Please sign in to comment.