Skip to content

Commit

Permalink
Reduced Warning Count By 130 For Full Rebuilds (space-wizards#26518)
Browse files Browse the repository at this point in the history
* remove deprecated entity coordinate extension functions. Reduces warning count by approximately 50

* final toCoords Removed

* Remove all unused variables and dead code paths

* remove always true variable, should be a cvar or something instead

* remove superfluous variables from tests
  • Loading branch information
Huxellberger authored Mar 29, 2024
1 parent cdfa7c3 commit 59e46aa
Show file tree
Hide file tree
Showing 69 changed files with 101 additions and 256 deletions.
2 changes: 0 additions & 2 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.Alerts;

Expand All @@ -13,7 +12,6 @@ public sealed class ClientAlertsSystem : AlertsSystem
{
public AlertOrderPrototype? AlertOrder { get; set; }

[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ClothingComponent clothing, str
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var correctedSlot = slot;
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Doors/DoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Timing;

namespace Content.Client.Doors;

public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

public override void Initialize()
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/IconSmoothing/IconSmoothSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace Content.Client.IconSmoothing
[UsedImplicitly]
public sealed partial class IconSmoothSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;

private readonly Queue<EntityUid> _dirtyEntities = new();
private readonly Queue<EntityUid> _anchorChangedEntities = new();

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Items/Systems/ItemSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ItemComponent item, string defa
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var state = (item.HeldPrefix == null)
Expand Down
1 change: 0 additions & 1 deletion Content.Client/NPC/PathfindingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ private void DrawScreen(OverlayDrawArgs args, DrawingHandleScreen screenHandle)

var invGridMatrix = gridXform.InvWorldMatrix;
DebugPathPoly? nearest = null;
var nearestDistance = float.MaxValue;

foreach (var poly in tile)
{
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ protected void DrawCircles(DrawingHandleScreen handle)
var cornerDistance = MathF.Sqrt(WorldRange * WorldRange + WorldRange * WorldRange);

var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));
var distOffset = -24f;

for (var radius = minDistance; radius <= maxDistance; radius *= EquatorialMultiplier)
{
Expand Down
5 changes: 0 additions & 5 deletions Content.IntegrationTests/PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,6 @@ await testOut.WriteLineAsync(
Pairs[fallback!] = true;
}

if (fallback == null && _pairId > 8)
{
var x = 2;
}

return fallback;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Content.IntegrationTests/Tests/Fluids/PuddleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ await server.WaitPost(() =>

await server.WaitAssertion(() =>
{
var coordinates = grid.ToCoordinates();
var coordinates = grid.Owner.ToCoordinates();
var solution = new Solution("Water", FixedPoint2.New(20));

Assert.That(spillSystem.TrySpillAt(coordinates, solution, out _), Is.False);
Expand Down
167 changes: 92 additions & 75 deletions Content.IntegrationTests/Tests/Power/PowerTest.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Content.IntegrationTests/Tests/PrototypeSaveTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ await server.WaitPost(() =>

var tileDefinition = tileDefinitionManager["FloorSteel"]; // Wires n such disable ambiance while under the floor
var tile = new Tile(tileDefinition.TileId);
var coordinates = grid.ToCoordinates();
var coordinates = grid.Owner.ToCoordinates();

grid.SetTile(coordinates, tile);
});
Expand Down Expand Up @@ -94,7 +94,7 @@ await server.WaitPost(() =>
await server.WaitAssertion(() =>
{
Assert.That(!mapManager.IsMapInitialized(mapId));
var testLocation = grid.ToCoordinates();
var testLocation = grid.Owner.ToCoordinates();

Assert.Multiple(() =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using Content.Server.GameTicking;
using Content.Server.Ghost.Components;
using Content.Server.Players;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Ghost;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Map;
Expand All @@ -17,7 +12,6 @@ namespace Content.Server.Administration.Commands;
public sealed class PersistenceSave : IConsoleCommand
{
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly IEntitySystemManager _system = default!;
[Dependency] private readonly IMapManager _map = default!;

Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Administration/Commands/VariantizeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;

namespace Content.Server.Administration.Commands;

[AdminCommand(AdminFlags.Mapping)]
public sealed class VariantizeCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;

public string Command => "variantize";
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Anomaly/Effects/EntityAnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects;
using Content.Shared.Anomaly.Effects.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Random;
Expand All @@ -12,7 +11,6 @@ namespace Content.Server.Anomaly.Effects;
public sealed class EntityAnomalySystem : SharedEntityAnomalySystem
{
[Dependency] private readonly SharedAnomalySystem _anomaly = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;

Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Atmos/EntitySystems/AirFilterSystem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Content.Server.Atmos;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Shared.Atmos;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using System.Diagnostics.CodeAnalysis;

Expand All @@ -15,7 +13,6 @@ public sealed class AirFilterSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

public override void Initialize()
{
Expand Down
4 changes: 0 additions & 4 deletions Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Numerics;
using Content.Server.Atmos.Components;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
Expand All @@ -17,8 +16,6 @@
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;

namespace Content.Server.Atmos.EntitySystems
Expand All @@ -33,7 +30,6 @@ public sealed class GasTankSystem : EntitySystem
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
public sealed class GasVolumePumpSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Lock;
using Robust.Server.GameObjects;
Expand All @@ -29,8 +28,6 @@ public sealed class GasCanisterSystem : EntitySystem
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
Expand Down
4 changes: 0 additions & 4 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
using Content.Shared.Movement.Events;
using Content.Shared.Movement.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using System.Numerics;

Expand All @@ -23,9 +21,7 @@ public sealed class BodySystem : SharedBodySystem
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;

public override void Initialize()
{
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Body/Systems/InternalsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
using Content.Server.Hands.Systems;
using Content.Server.Popups;
using Content.Shared.Alert;
using Content.Shared.Atmos;
Expand All @@ -11,7 +10,6 @@
using Content.Shared.Inventory;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Server.Body.Systems;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Cargo/Systems/CargoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public sealed partial class CargoSystem : SharedCargoSystem
[Dependency] private readonly PricingSystem _pricing = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly StationSystem _station = default!;
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Cargo/Systems/PricingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Content.Shared.Stacks;
using Robust.Shared.Console;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
Expand All @@ -27,7 +26,6 @@ public sealed class PricingSystem : EntitySystem
{
[Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly IConsoleHost _consoleHost = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
using Content.Shared.FixedPoint;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using System.Numerics;

namespace Content.Server.Chemistry.Containers.EntitySystems;

public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem
{
[Dependency] private readonly INetManager _netManager = default!;

public override void Initialize()
{
base.Initialize();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Content.Server.Administration.Logs;
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Nutrition.EntitySystems;
Expand Down Expand Up @@ -30,7 +29,6 @@ public sealed class ReagentDispenserSystem : EntitySystem
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly OpenableSystem _openable = default!;

public override void Initialize()
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Decals/Commands/EditDecalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;

namespace Content.Server.Decals;
Expand All @@ -11,7 +10,6 @@ namespace Content.Server.Decals;
public sealed class EditDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

public string Command => "editdecal";
public string Description => "Edits a decal.";
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Decals/Commands/RemoveDecalCommand.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using SQLitePCL;

namespace Content.Server.Decals.Commands
{
[AdminCommand(AdminFlags.Mapping)]
public sealed class RemoveDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

public string Command => "rmdecal";
public string Description => "removes a decal";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disposal.Tube;
using Content.Server.Disposal.Tube.Components;
Expand All @@ -12,14 +11,12 @@
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Random;

namespace Content.Server.Disposal.Unit.EntitySystems
{
public sealed class DisposableSystem : EntitySystem
{
[Dependency] private readonly ThrowingSystem _throwing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly DisposalUnitSystem _disposalUnitSystem = default!;
Expand Down
Loading

0 comments on commit 59e46aa

Please sign in to comment.