diff --git a/Content.Client/_DVA/.editorconfig b/Content.Client/_DVA/.editorconfig new file mode 100644 index 0000000000..3fd44f1cb3 --- /dev/null +++ b/Content.Client/_DVA/.editorconfig @@ -0,0 +1,7 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces diff --git a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs index 4e0a226e67..74680f53e2 100644 --- a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs +++ b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs @@ -22,7 +22,7 @@ public sealed partial class DVCrewMonitoringShuttleControl : BaseShuttleControl public EntityUid? Owner; public NavMapControl? NavMap; - private List> _grids = new(); + private List> _grids = []; public DVCrewMonitoringShuttleControl() : base(64f, 256f, 256f) { @@ -57,7 +57,9 @@ protected override void Draw(DrawingHandleScreen handle) var mapPos = _transform.ToMapCoordinates(coordinates); var ourEntRot = Angle.Zero; var ourEntMatrix = Matrix3Helpers.CreateTransform(_transform.GetWorldPosition(xform), ourEntRot); - Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle); + if (!Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle)) + return; + var shuttleToView = Matrix3x2.CreateScale(new Vector2(MinimapScale, -MinimapScale)) * Matrix3x2.CreateTranslation(MidPointVector); var worldToView = worldToShuttle * shuttleToView; @@ -73,7 +75,8 @@ protected override void Draw(DrawingHandleScreen handle) continue; var body = bodyQuery.GetComponent(grid); - iffQuery.TryComp(grid, out var iff); + if (iffQuery.TryComp(grid, out var iff)) + continue; if (!_shuttles.CanDraw(grid, body, iff)) continue; @@ -138,10 +141,13 @@ protected override void KeyBindUp(GUIBoundKeyEventArgs args) var ourEntRot = Angle.Zero; var ourEntMatrix = Matrix3Helpers.CreateTransform(_transform.GetWorldPosition(xform), ourEntRot); - Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle); + if (!Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle)) + return; + var shuttleToView = Matrix3x2.CreateScale(new Vector2(MinimapScale, -MinimapScale)) * Matrix3x2.CreateTranslation(MidPointVector); var worldToView = worldToShuttle * shuttleToView; - Matrix3x2.Invert(worldToView, out var viewToWorld); + if (!Matrix3x2.Invert(worldToView, out var viewToWorld)) + return; if (args.Function == EngineKeyFunctions.UIClick) { diff --git a/Content.Server/_DVA/.editorconfig b/Content.Server/_DVA/.editorconfig new file mode 100644 index 0000000000..3fd44f1cb3 --- /dev/null +++ b/Content.Server/_DVA/.editorconfig @@ -0,0 +1,7 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces diff --git a/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs b/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs index 0eb11cbd86..5edbf4591e 100644 --- a/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs +++ b/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs @@ -58,7 +58,7 @@ public EntityUid Get(IInvocationContext ctx) public record struct GlimmerMissingError : IConError { - public FormattedMessage DescribeInner() + public readonly FormattedMessage DescribeInner() { return FormattedMessage.FromMarkupOrThrow("This command doesn't function if there's no glimmer. Is the round started?"); } diff --git a/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs b/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs index d5d6af5de7..9d10e2989c 100644 --- a/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs +++ b/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs @@ -21,7 +21,7 @@ public override void Initialize() private void OnPostGameMapLoad(PostGameMapLoad ev) { var ent = Spawn(); - AddComp(ent); + _ = AddComp(ent); _pvsOverride.AddGlobalOverride(ent); } } diff --git a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs index 027be85584..36e3eab3ee 100644 --- a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs +++ b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs @@ -49,7 +49,7 @@ private void OnPacketReceived(Entity ent, ref Devi .Intersect(ent.Comp.AlertedSensors); // Find "alerted" people that are healthy if (staleAlerts.Any()) - ent.Comp.AlertedSensors.RemoveWhere(alert => staleAlerts.Contains(alert)); + _ = ent.Comp.AlertedSensors.RemoveWhere(alert => staleAlerts.Contains(alert)); // alert is still on cooldown, defer checking if we should alert if (ent.Comp.LastAlert + ent.Comp.AlertCooldown > _timing.CurTime) @@ -73,12 +73,12 @@ private void OnPacketReceived(Entity ent, ref Devi private void Alert(Entity monitor) { var audioParams = AudioParams.Default.WithVolume(-2f).WithMaxDistance(4f); - _audio.PlayPvs(monitor.Comp.AlertSound, monitor.Owner, audioParams); + _ = _audio.PlayPvs(monitor.Comp.AlertSound, monitor.Owner, audioParams); monitor.Comp.LastAlert = _timing.CurTime; } - private bool IsCriticalOrDead(SuitSensorStatus status) + private static bool IsCriticalOrDead(SuitSensorStatus status) { return !status.IsAlive || status.DamagePercentage >= 1f; } -} \ No newline at end of file +} diff --git a/Content.Shared/_DVA/.editorconfig b/Content.Shared/_DVA/.editorconfig new file mode 100644 index 0000000000..4c21ef7205 --- /dev/null +++ b/Content.Shared/_DVA/.editorconfig @@ -0,0 +1,8 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces +dotnet_diagnostic.CA1716.severity = none # Ignore: Rename to no longer conflict with Shared (Reserved wording) diff --git a/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs b/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs index f7071144d0..81405ff30f 100644 --- a/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs +++ b/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs @@ -1,4 +1,3 @@ -using System.Linq; using Content.Shared._DVA.Utility; using Robust.Shared.GameStates; using Robust.Shared.Serialization; diff --git a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs index 953010ad2c..d658431122 100644 --- a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs +++ b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs @@ -1,7 +1,6 @@ using System.Linq; using JetBrains.Annotations; using Robust.Shared.GameStates; -using Robust.Shared.Network; using Robust.Shared.Serialization; namespace Content.Shared._DVA.Glimmer; @@ -11,8 +10,6 @@ namespace Content.Shared._DVA.Glimmer; /// public sealed partial class DVGlimmerSystem : EntitySystem { - [Dependency] private INetManager _net = default!; - /// /// The current glimmer of the round. /// @@ -33,10 +30,7 @@ public int Glimmer /// The current glimmer tier of the round. /// [PublicAPI] - public GlimmerTier GlimmerTier - { - get => Entity?.Comp.Tier ?? GlimmerTier.Minimal; - } + public GlimmerTier GlimmerTier => Entity?.Comp.Tier ?? GlimmerTier.Minimal; /// /// Returns the current glimmer entity for the round, if any.