Skip to content

Commit

Permalink
марк, я марки свои не чувствую
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFoxIV committed Dec 6, 2024
1 parent b56129d commit 52ed4f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Content.Shared/CombatMode/CombatModeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public sealed partial class CombatModeComponent : Component
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;


// WD EDIT 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,
Expand All @@ -61,5 +61,6 @@ public sealed partial class CombatModeComponent : Component
/// </remarks>
[DataField, AutoNetworkedField]
public bool SmoothRotation = true;
// WD EDIT END
}
}
2 changes: 2 additions & 0 deletions Content.Shared/CombatMode/SharedCombatModeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ private void SetMouseRotatorComponents(EntityUid uid, bool value)
if (value)
{
var rot = EnsureComp<MouseRotatorComponent>(uid);
// WD EDIT 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;
}
// WD EDIT END
EnsureComp<NoRotateOnMoveComponent>(uid);
}
else
Expand Down

0 comments on commit 52ed4f9

Please sign in to comment.