diff --git a/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs b/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs index f805fc59f1..3739093ea1 100644 --- a/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs +++ b/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs @@ -23,10 +23,7 @@ namespace Content.Client.GameObjects.Components.Suspicion [Dependency] private readonly IGameHud _gameHud = default!; [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IComponentManager _componentManager = default!; - [Dependency] private readonly IInputManager _inputManager = default!; [Dependency] private readonly IEyeManager _eyeManager = default!; private SuspicionGui? _gui; diff --git a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs b/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs index b00b98485f..5b63db19f2 100644 --- a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs +++ b/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs @@ -22,7 +22,6 @@ namespace Content.Client.GameObjects.EntitySystems internal sealed class AtmosDebugOverlaySystem : SharedAtmosDebugOverlaySystem { [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; private Dictionary _tileData = new Dictionary(); diff --git a/Content.Client/UserInterface/ItemSlotManager.cs b/Content.Client/UserInterface/ItemSlotManager.cs index e3fcbb3e56..ee72f3c908 100644 --- a/Content.Client/UserInterface/ItemSlotManager.cs +++ b/Content.Client/UserInterface/ItemSlotManager.cs @@ -78,7 +78,10 @@ namespace Content.Client.UserInterface grid.MapToGrid(mousePosWorld), args.PointerLocation, item.Uid); // client side command handlers will always be sent the local player session. - var session = _playerManager.LocalPlayer.Session; + var session = _playerManager.LocalPlayer?.Session; + if (session == null) + return false; + inputSys.HandleInputCommand(session, func, message); } else diff --git a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs index 012ad5fdb0..1bb4961e25 100644 --- a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs @@ -845,7 +845,7 @@ namespace Content.Server.GameObjects.Components.Atmos { Tiles.Add(indices, new TileAtmosphere(this, gridId, indices, (GasMixture)uniqueMixes![mix].Clone())); } - catch (ArgumentOutOfRangeException e) + catch (ArgumentOutOfRangeException) { Logger.Error($"Error during atmos serialization! Tile at {indices} points to an unique mix ({mix}) out of range!"); throw; diff --git a/Content.Server/GameObjects/Components/AtmosPlaqueComponent.cs b/Content.Server/GameObjects/Components/AtmosPlaqueComponent.cs index 7b4112d8a1..4107589cc5 100644 --- a/Content.Server/GameObjects/Components/AtmosPlaqueComponent.cs +++ b/Content.Server/GameObjects/Components/AtmosPlaqueComponent.cs @@ -64,7 +64,8 @@ namespace Content.Server.GameObjects.Components "This plaque commemorates the fall of the Atmos LINDA division. For all the charred, dizzy, and brittle men who have died in its hands.", PlaqueType.Zas => "This plaque commemorates the fall of the Atmos ZAS division. For all the charred, dizzy, and brittle men who have died in its hands.", - PlaqueType.Unset => "Uhm" + PlaqueType.Unset => "Uhm", + _ => "Uhm", }; Owner.Name = _type switch @@ -77,7 +78,8 @@ namespace Content.Server.GameObjects.Components "LINDA Atmospherics Division plaque", PlaqueType.Zas => "ZAS Atmospherics Division plaque", - PlaqueType.Unset => "Uhm" + PlaqueType.Unset => "Uhm", + _ => "Uhm", }; if (Owner.TryGetComponent(out SpriteComponent sprite)) diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 2cefa24394..e44e52deaa 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -32,7 +32,6 @@ namespace Content.Server.GameObjects.Components.Construction { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; public override string Name => "Construction"; diff --git a/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs index 3da7723835..ebefffd567 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs @@ -15,8 +15,6 @@ namespace Content.Server.GameObjects.Components.Items.Storage [RegisterComponent] internal sealed class StorageFillComponent : Component, IMapInit { - [Dependency] private readonly IEntityManager _entityManager; - public override string Name => "StorageFill"; private List _contents; @@ -56,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage for (var i = 0; i < storageItem.Amount; i++) { - storage.Insert(_entityManager.SpawnEntity(storageItem.PrototypeName, Owner.Transform.Coordinates)); + storage.Insert(Owner.EntityManager.SpawnEntity(storageItem.PrototypeName, Owner.Transform.Coordinates)); } if (!string.IsNullOrEmpty(storageItem.GroupId)) alreadySpawnedGroups.Add(storageItem.GroupId); } diff --git a/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs b/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs index 229bc46d2f..7f9a1be823 100644 --- a/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs @@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech [RegisterComponent] public class OwOAccentComponent : Component, IAccentComponent { - [Dependency] private readonly IRobustRandom _random; + [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "OwOAccent"; diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs index 5f2ed4bf49..ed5819f3b5 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs @@ -24,8 +24,6 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents [RegisterComponent] public class PowerProviderComponent : BaseApcNetComponent, IPowerProvider { - [Dependency] private readonly IServerEntityManager _serverEntityManager; - public override string Name => "PowerProvider"; /// @@ -93,13 +91,13 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents private List FindAvailableReceivers() { - var nearbyEntities = _serverEntityManager + var nearbyEntities = Owner.EntityManager .GetEntitiesInRange(Owner, PowerTransferRange); return nearbyEntities.Select(entity => entity.TryGetComponent(out var receiver) ? receiver : null) .Where(receiver => receiver != null) .Where(receiver => receiver.Connectable) .Where(receiver => receiver.NeedsProvider) - .Where(receiver => receiver.Owner.Transform.Coordinates.TryDistance(_serverEntityManager, Owner.Transform.Coordinates, out var distance) && distance < Math.Min(PowerTransferRange, receiver.PowerReceptionRange)) + .Where(receiver => receiver.Owner.Transform.Coordinates.TryDistance(Owner.EntityManager, Owner.Transform.Coordinates, out var distance) && distance < Math.Min(PowerTransferRange, receiver.PowerReceptionRange)) .ToList(); } diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index 5d802704f1..6dcb6adfdb 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -29,8 +29,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee private TimeSpan _lastAttackTime; private TimeSpan _cooldownEnd; - private readonly string _hitSound; - private readonly string _missSound; + private readonly string _hitSound = default!; + private readonly string _missSound = default!; public float ArcCooldownTime { get; private set; } = 1f; public float CooldownTime { get; private set; } = 0.5f; @@ -93,7 +93,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee var entities = ArcRayCast(eventArgs.User.Transform.WorldPosition, angle, eventArgs.User); var audioSystem = EntitySystem.Get(); - if (entities.Count() != 0) + if (entities.Count != 0) { audioSystem.PlayFromEntity( _hitSound, entities.First()); } diff --git a/Content.Server/StationEvents/RadiationStorm.cs b/Content.Server/StationEvents/RadiationStorm.cs index e3d1027887..61444861d9 100644 --- a/Content.Server/StationEvents/RadiationStorm.cs +++ b/Content.Server/StationEvents/RadiationStorm.cs @@ -23,7 +23,6 @@ namespace Content.Server.StationEvents // Based on Goonstation style radiation storm with some TG elements (announcer, etc.) [Dependency] private IEntityManager _entityManager = default!; - [Dependency] private IMapManager _mapManager = default!; [Dependency] private IRobustRandom _robustRandom = default!; public override string Name => "RadiationStorm"; @@ -72,7 +71,6 @@ namespace Content.Server.StationEvents // IOC uninject? _entityManager = null; - _mapManager = null; _robustRandom = null; var componentManager = IoCManager.Resolve();