diff --git a/Content.Client/ClickMapManager.cs b/Content.Client/ClickMapManager.cs
index a9938f05c8..36d5382157 100644
--- a/Content.Client/ClickMapManager.cs
+++ b/Content.Client/ClickMapManager.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System;
using System.Collections.Generic;
using System.Text;
@@ -11,8 +12,6 @@ using Robust.Shared.ViewVariables;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
-#nullable enable
-
namespace Content.Client
{
internal class ClickMapManager : IClickMapManager, IPostInjectInit
diff --git a/Content.Client/GameObjects/Components/ClickableComponent.cs b/Content.Client/GameObjects/Components/ClickableComponent.cs
index 3b36e8d38a..57d9420167 100644
--- a/Content.Client/GameObjects/Components/ClickableComponent.cs
+++ b/Content.Client/GameObjects/Components/ClickableComponent.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System;
using Robust.Client.Graphics.ClientEye;
using Robust.Client.Interfaces.GameObjects.Components;
@@ -8,8 +9,6 @@ using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
-#nullable enable
-
namespace Content.Client.GameObjects.Components
{
[RegisterComponent]
diff --git a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs
index 2791aa7ddb..69d364fd5f 100644
--- a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs
+++ b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs
@@ -1,24 +1,17 @@
+#nullable enable
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using Content.Shared.GameObjects.Components.Instruments;
using Content.Shared.Physics;
-using JetBrains.Annotations;
-using NFluidsynth;
using Robust.Shared.GameObjects;
using Robust.Client.Audio.Midi;
-using Robust.Client.Player;
-using Robust.Shared.Interfaces.Log;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
-using Robust.Shared.Log;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
-using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
-using Logger = Robust.Shared.Log.Logger;
using MidiEvent = Robust.Shared.Audio.Midi.MidiEvent;
using Timer = Robust.Shared.Timers.Timer;
@@ -32,24 +25,23 @@ namespace Content.Client.GameObjects.Components.Instruments
///
/// Called when a midi song stops playing.
///
- public event Action OnMidiPlaybackEnded;
+ public event Action? OnMidiPlaybackEnded;
#pragma warning disable 649
- [Dependency] private readonly IMidiManager _midiManager;
+ [Dependency] private readonly IMidiManager _midiManager = default!;
- [Dependency] private readonly IGameTiming _gameTiming;
+ [Dependency] private readonly IGameTiming _gameTiming = default!;
- [Dependency] private readonly IClientNetManager _netManager;
+ [Dependency] private readonly IClientNetManager _netManager = default!;
#pragma warning restore 649
- [CanBeNull]
- private IMidiRenderer _renderer;
+ private IMidiRenderer? _renderer;
private byte _instrumentProgram = 1;
- private byte _instrumentBank = 0;
+ private byte _instrumentBank;
- private uint _sequenceDelay = 0;
+ private uint _sequenceDelay;
private uint _sequenceStartTick;
@@ -209,7 +201,7 @@ namespace Content.Client.GameObjects.Components.Instruments
serializer.DataField(ref _instrumentBank, "bank", (byte) 0);
}
- public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession session = null)
+ public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, channel, session);
@@ -240,7 +232,7 @@ namespace Content.Client.GameObjects.Components.Instruments
.Min(x => x.Tick) - 1;
}
- var sqrtLag = MathF.Sqrt(_netManager.ServerChannel.Ping / 1000f);
+ var sqrtLag = MathF.Sqrt(_netManager.ServerChannel!.Ping / 1000f);
var delay = (uint) (_renderer!.SequencerTimeScale * (.2 + sqrtLag));
var delta = delay - _sequenceStartTick;
@@ -265,12 +257,12 @@ namespace Content.Client.GameObjects.Components.Instruments
}
break;
- case InstrumentStartMidiMessage startMidiMessage:
+ case InstrumentStartMidiMessage _:
{
SetupRenderer(true);
break;
}
- case InstrumentStopMidiMessage stopMidiMessage:
+ case InstrumentStopMidiMessage _:
{
EndRenderer(true);
break;
@@ -278,7 +270,7 @@ namespace Content.Client.GameObjects.Components.Instruments
}
}
- public override void HandleComponentState(ComponentState curState, ComponentState nextState)
+ public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (!(curState is InstrumentState state)) return;
@@ -370,7 +362,7 @@ namespace Content.Client.GameObjects.Components.Instruments
private TimeSpan _lastMeasured = TimeSpan.MinValue;
- private int _sentWithinASec = 0;
+ private int _sentWithinASec;
private static readonly TimeSpan OneSecAgo = TimeSpan.FromSeconds(-1);
diff --git a/Content.Client/GameObjects/Components/Mobs/StatusControl.cs b/Content.Client/GameObjects/Components/Mobs/StatusControl.cs
index 591bf9e1c9..7df0225a90 100644
--- a/Content.Client/GameObjects/Components/Mobs/StatusControl.cs
+++ b/Content.Client/GameObjects/Components/Mobs/StatusControl.cs
@@ -1,5 +1,5 @@
-using Content.Shared.GameObjects.Components.Mobs;
-using JetBrains.Annotations;
+#nullable enable
+using Content.Shared.GameObjects.Components.Mobs;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Mobs
{
public readonly StatusEffect Effect;
- public StatusControl(StatusEffect effect, [CanBeNull] Texture texture)
+ public StatusControl(StatusEffect effect, Texture? texture)
{
Effect = effect;
diff --git a/Content.Client/GameObjects/Components/Mobs/StunnableComponent.cs b/Content.Client/GameObjects/Components/Mobs/StunnableComponent.cs
index 7ff78391ca..7c01000dd4 100644
--- a/Content.Client/GameObjects/Components/Mobs/StunnableComponent.cs
+++ b/Content.Client/GameObjects/Components/Mobs/StunnableComponent.cs
@@ -1,9 +1,8 @@
+#nullable enable
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Movement;
using Robust.Shared.GameObjects;
-#nullable enable
-
namespace Content.Client.GameObjects.Components.Mobs
{
[RegisterComponent]
diff --git a/Content.Client/GameObjects/Components/Movement/PlayerInputMoverComponent.cs b/Content.Client/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
index 50bcbd2790..fcdde82ef8 100644
--- a/Content.Client/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
+++ b/Content.Client/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
@@ -1,14 +1,13 @@
+#nullable enable
using Content.Shared.GameObjects.Components.Movement;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
-#nullable enable
-
namespace Content.Client.GameObjects.Components.Movement
{
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent))]
- public class PlayerInputMoverComponent : SharedPlayerInputMoverComponent, IMoverComponent
+ public class PlayerInputMoverComponent : SharedPlayerInputMoverComponent
{
public override GridCoordinates LastPosition { get; set; }
public override float StepSoundDistance { get; set; }
diff --git a/Content.Client/GameObjects/Components/Nutrition/HungerComponent.cs b/Content.Client/GameObjects/Components/Nutrition/HungerComponent.cs
index fa66e98812..8323fb5e7a 100644
--- a/Content.Client/GameObjects/Components/Nutrition/HungerComponent.cs
+++ b/Content.Client/GameObjects/Components/Nutrition/HungerComponent.cs
@@ -1,9 +1,8 @@
+#nullable enable
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.GameObjects.Components.Nutrition;
using Robust.Shared.GameObjects;
-#nullable enable
-
namespace Content.Client.GameObjects.Components.Nutrition
{
[RegisterComponent]
diff --git a/Content.Client/GameObjects/Components/Nutrition/ThirstComponent.cs b/Content.Client/GameObjects/Components/Nutrition/ThirstComponent.cs
index 10b63d054b..b77d59a34a 100644
--- a/Content.Client/GameObjects/Components/Nutrition/ThirstComponent.cs
+++ b/Content.Client/GameObjects/Components/Nutrition/ThirstComponent.cs
@@ -1,9 +1,8 @@
+#nullable enable
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.GameObjects.Components.Nutrition;
using Robust.Shared.GameObjects;
-#nullable enable
-
namespace Content.Client.GameObjects.Components.Nutrition
{
[RegisterComponent]
diff --git a/Content.Client/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Client/GameObjects/Components/Projectiles/ProjectileComponent.cs
index 27e8ed6285..9abf4a557b 100644
--- a/Content.Client/GameObjects/Components/Projectiles/ProjectileComponent.cs
+++ b/Content.Client/GameObjects/Components/Projectiles/ProjectileComponent.cs
@@ -1,8 +1,7 @@
+#nullable enable
using Content.Shared.GameObjects.Components.Projectiles;
using Robust.Shared.GameObjects;
-#nullable enable
-
namespace Content.Client.GameObjects.Components.Projectiles
{
[RegisterComponent]
diff --git a/Content.Client/GameObjects/EntitySystems/MoverSystem.cs b/Content.Client/GameObjects/EntitySystems/MoverSystem.cs
index 37689e355c..84fe87bf25 100644
--- a/Content.Client/GameObjects/EntitySystems/MoverSystem.cs
+++ b/Content.Client/GameObjects/EntitySystems/MoverSystem.cs
@@ -1,4 +1,5 @@
-using Content.Shared.GameObjects.Components.Movement;
+#nullable enable
+using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Physics;
using JetBrains.Annotations;
@@ -7,8 +8,6 @@ using Robust.Client.Player;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.IoC;
-#nullable enable
-
namespace Content.Client.GameObjects.EntitySystems
{
[UsedImplicitly]
diff --git a/Content.Client/UserInterface/CreditsWindow.cs b/Content.Client/UserInterface/CreditsWindow.cs
index 56ac89f153..1bdd4c7a76 100644
--- a/Content.Client/UserInterface/CreditsWindow.cs
+++ b/Content.Client/UserInterface/CreditsWindow.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -13,8 +14,6 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
-#nullable enable
-
namespace Content.Client.UserInterface
{
public sealed class CreditsWindow : SS14Window
diff --git a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs
index 794dfb0fe6..93d2db7549 100644
--- a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs
+++ b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -15,8 +16,6 @@ using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Timing;
-#nullable enable
-
namespace Content.IntegrationTests.Tests.Networking
{
// This test checks that the prediction & reconciling system is working correctly with a simple boolean flag.
diff --git a/Content.Server/GameObjects/Components/Access/AccessComponent.cs b/Content.Server/GameObjects/Components/Access/AccessComponent.cs
index 060f418634..101f215c15 100644
--- a/Content.Server/GameObjects/Components/Access/AccessComponent.cs
+++ b/Content.Server/GameObjects/Components/Access/AccessComponent.cs
@@ -1,11 +1,10 @@
+#nullable enable
using System.Collections.Generic;
using Content.Server.Interfaces;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
-#nullable enable
-
namespace Content.Server.GameObjects.Components.Access
{
///
diff --git a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs
index 2a1d18ac41..94f06bc4a2 100644
--- a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs
+++ b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,8 +11,6 @@ using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
-#nullable enable
-
namespace Content.Server.GameObjects.Components.Access
{
///
@@ -68,7 +67,6 @@ namespace Content.Server.GameObjects.Components.Access
return _accessLists.Count == 0 || _accessLists.Any(a => a.IsSubsetOf(accessTags));
}
- [CanBeNull]
public static ICollection FindAccessTags(IEntity entity)
{
if (entity.TryGetComponent(out IAccess accessComponent))
diff --git a/Content.Server/GameObjects/Components/Access/PresetIdCardComponent.cs b/Content.Server/GameObjects/Components/Access/PresetIdCardComponent.cs
index 3895218154..67c6d08a76 100644
--- a/Content.Server/GameObjects/Components/Access/PresetIdCardComponent.cs
+++ b/Content.Server/GameObjects/Components/Access/PresetIdCardComponent.cs
@@ -1,3 +1,4 @@
+#nullable enable
using Content.Shared.Jobs;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
@@ -5,8 +6,6 @@ using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
-#nullable enable
-
namespace Content.Server.GameObjects.Components.Access
{
[RegisterComponent]
diff --git a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs
index cd5effccc2..78c30dc9b4 100644
--- a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs
+++ b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs
@@ -1,10 +1,10 @@
-using Content.Server.Cargo;
+#nullable enable
+using Content.Server.Cargo;
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.GameObjects.Components.Cargo;
using Content.Shared.Prototypes.Cargo;
-using JetBrains.Annotations;
using Robust.Server.GameObjects.Components.UserInterface;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
@@ -20,39 +20,43 @@ namespace Content.Server.GameObjects.Components.Cargo
public class CargoConsoleComponent : SharedCargoConsoleComponent, IActivate
{
#pragma warning disable 649
- [Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager;
+ [Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager = default!;
#pragma warning restore 649
[ViewVariables]
public int Points = 1000;
- private BoundUserInterface _userInterface;
+ private BoundUserInterface _userInterface = default!;
[ViewVariables]
- public GalacticMarketComponent Market { get; private set; }
- [ViewVariables]
- public CargoOrderDatabaseComponent Orders { get; private set; }
-
- private CargoBankAccount _bankAccount;
+ public GalacticMarketComponent Market { get; private set; } = default!;
[ViewVariables]
- [CanBeNull]
- public CargoBankAccount BankAccount
+ public CargoOrderDatabaseComponent Orders { get; private set; } = default!;
+
+ private CargoBankAccount? _bankAccount;
+
+ [ViewVariables]
+ public CargoBankAccount? BankAccount
{
get => _bankAccount;
private set
{
if (_bankAccount == value)
+ {
return;
+ }
+
if (_bankAccount != null)
{
_bankAccount.OnBalanceChange -= UpdateUIState;
}
_bankAccount = value;
+
if (value != null)
{
- _bankAccount.OnBalanceChange += UpdateUIState;
+ value.OnBalanceChange += UpdateUIState;
}
UpdateUIState();
@@ -61,9 +65,9 @@ namespace Content.Server.GameObjects.Components.Cargo
private bool _requestOnly = false;
- private PowerReceiverComponent _powerReceiver;
+ private PowerReceiverComponent _powerReceiver = default!;
private bool Powered => _powerReceiver.Powered;
- private CargoConsoleSystem _cargoConsoleSystem;
+ private CargoConsoleSystem _cargoConsoleSystem = default!;
public override void Initialize()
{
@@ -98,8 +102,11 @@ namespace Content.Server.GameObjects.Components.Cargo
{
case CargoConsoleAddOrderMessage msg:
{
- if (msg.Amount <= 0)
+ if (msg.Amount <= 0 || _bankAccount == null)
+ {
break;
+ }
+
_cargoOrderDataManager.AddOrder(Orders.Database.Id, msg.Requester, msg.Reason, msg.ProductId, msg.Amount, _bankAccount.Id);
break;
}
@@ -111,8 +118,12 @@ namespace Content.Server.GameObjects.Components.Cargo
case CargoConsoleApproveOrderMessage msg:
{
if (_requestOnly ||
- !Orders.Database.TryGetOrder(msg.OrderNumber, out var order))
+ !Orders.Database.TryGetOrder(msg.OrderNumber, out var order) ||
+ _bankAccount == null)
+ {
break;
+ }
+
_prototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product);
if (product == null)
break;
diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs
index 485624b5de..509baf88b1 100644
--- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs
+++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs
@@ -1,4 +1,5 @@
-using Content.Server.GameObjects.Components.Strap;
+#nullable enable
+using Content.Server.GameObjects.Components.Strap;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
@@ -8,7 +9,6 @@ using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Strap;
using Content.Shared.GameObjects.EntitySystems;
-using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
@@ -25,15 +25,15 @@ namespace Content.Server.GameObjects.Components.Mobs
public class BuckleComponent : SharedBuckleComponent, IInteractHand, IDragDrop
{
#pragma warning disable 649
- [Dependency] private readonly IEntitySystemManager _entitySystem;
- [Dependency] private readonly IServerNotifyManager _notifyManager;
+ [Dependency] private readonly IEntitySystemManager _entitySystem = default!;
+ [Dependency] private readonly IServerNotifyManager _notifyManager = default!;
#pragma warning restore 649
- [CanBeNull] private StrapComponent _buckledTo;
+ private StrapComponent? _buckledTo;
private int _size;
- [ViewVariables, CanBeNull]
- public StrapComponent BuckledTo
+ [ViewVariables]
+ public StrapComponent? BuckledTo
{
get => _buckledTo;
private set
diff --git a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
index e1e617774e..d3ba8882db 100644
--- a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
+++ b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs
@@ -1,11 +1,7 @@
-using Content.Shared.GameObjects.Components.Movement;
+#nullable enable
+using Content.Shared.GameObjects.Components.Movement;
using Robust.Shared.GameObjects;
-using Robust.Shared.GameObjects.Components;
using Robust.Shared.Map;
-using Robust.Shared.Physics;
-using Robust.Shared.ViewVariables;
-
-#nullable enable
namespace Content.Server.GameObjects.Components.Movement
{
diff --git a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs
index e4a02108e5..c14cce399f 100644
--- a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs
+++ b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs
@@ -1,3 +1,4 @@
+#nullable enable
using System;
using System.Collections;
using System.Collections.Generic;
@@ -22,8 +23,6 @@ using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
-#nullable enable
-
namespace Content.Server.GameObjects.Components.PDA
{
[RegisterComponent]
diff --git a/Content.Server/GameObjects/Components/WiresComponent.cs b/Content.Server/GameObjects/Components/WiresComponent.cs
index 2c8534edd6..8af306e51e 100644
--- a/Content.Server/GameObjects/Components/WiresComponent.cs
+++ b/Content.Server/GameObjects/Components/WiresComponent.cs
@@ -1,4 +1,5 @@
-using System;
+#nullable enable
+using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Interactable;
@@ -32,12 +33,12 @@ namespace Content.Server.GameObjects.Components
public class WiresComponent : SharedWiresComponent, IInteractUsing, IExamine, IMapInit
{
#pragma warning disable 649
- [Dependency] private readonly IRobustRandom _random;
- [Dependency] private readonly IServerNotifyManager _notifyManager;
+ [Dependency] private readonly IRobustRandom _random = default!;
+ [Dependency] private readonly IServerNotifyManager _notifyManager = default!;
#pragma warning restore 649
- private AudioSystem _audioSystem;
- private AppearanceComponent _appearance;
- private BoundUserInterface _userInterface;
+ private AudioSystem _audioSystem = default!;
+ private AppearanceComponent _appearance = default!;
+ private BoundUserInterface _userInterface = default!;
private bool _isPanelOpen;
@@ -93,7 +94,7 @@ namespace Content.Server.GameObjects.Components
}
[ViewVariables(VVAccess.ReadWrite)]
- public string SerialNumber
+ public string? SerialNumber
{
get => _serialNumber;
set
@@ -127,16 +128,16 @@ namespace Content.Server.GameObjects.Components
private readonly List _availableLetters =
new List((WireLetter[]) Enum.GetValues(typeof(WireLetter)));
- private string _boardName;
+ private string _boardName = default!;
- private string _serialNumber;
+ private string? _serialNumber;
// Used to generate wire appearance randomization client side.
// We honestly don't care what it is or such but do care that it doesn't change between UI re-opens.
[ViewVariables]
private int _wireSeed;
[ViewVariables]
- private string _layoutId;
+ private string? _layoutId;
public override void Initialize()
{
@@ -186,7 +187,7 @@ namespace Content.Server.GameObjects.Components
base.Startup();
- WireLayout layout = null;
+ WireLayout? layout = null;
var hackingSystem = EntitySystem.Get();
if (_layoutId != null)
{
@@ -299,9 +300,9 @@ namespace Content.Server.GameObjects.Components
{
[NotNull] private readonly WiresComponent _wires;
[NotNull] private readonly IWires _owner;
- [CanBeNull] private readonly WireLayout _layout;
+ private readonly WireLayout? _layout;
- public WiresBuilder(WiresComponent wires, IWires owner, WireLayout layout)
+ public WiresBuilder(WiresComponent wires, IWires owner, WireLayout? layout)
{
_wires = wires;
_owner = owner;
@@ -365,12 +366,12 @@ namespace Content.Server.GameObjects.Components
{
case WiresActionMessage msg:
var wire = WiresList.Find(x => x.Id == msg.Id);
- if (wire == null)
+ var player = serverMsg.Session.AttachedEntity;
+ if (wire == null || player == null)
{
return;
}
- var player = serverMsg.Session.AttachedEntity;
if (!player.TryGetComponent(out IHandsComponent handsComponent))
{
_notifyManager.PopupMessage(Owner.Transform.GridPosition, player,
@@ -386,7 +387,7 @@ namespace Content.Server.GameObjects.Components
}
var activeHandEntity = handsComponent.GetActiveHand?.Owner;
- ToolComponent tool = null;
+ ToolComponent? tool = null;
activeHandEntity?.TryGetComponent(out tool);
switch (msg.Action)
diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs
index 626e86a18e..bb1d181930 100644
--- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs
+++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs
@@ -1,4 +1,5 @@
-using Content.Server.GameObjects;
+#nullable enable
+using Content.Server.GameObjects;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Movement;
@@ -23,8 +24,6 @@ using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
-#nullable enable
-
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
diff --git a/Content.Server/Interfaces/IAccess.cs b/Content.Server/Interfaces/IAccess.cs
index f50cae8214..f271990545 100644
--- a/Content.Server/Interfaces/IAccess.cs
+++ b/Content.Server/Interfaces/IAccess.cs
@@ -1,9 +1,8 @@
+#nullable enable
using System;
using Content.Server.GameObjects.Components.Access;
using System.Collections.Generic;
-#nullable enable
-
namespace Content.Server.Interfaces
{
///
diff --git a/Content.Shared/GameObjects/Components/Movement/SharedPlayerInputMoverComponent.cs b/Content.Shared/GameObjects/Components/Movement/SharedPlayerInputMoverComponent.cs
index cb47ac544c..edd3e03d37 100644
--- a/Content.Shared/GameObjects/Components/Movement/SharedPlayerInputMoverComponent.cs
+++ b/Content.Shared/GameObjects/Components/Movement/SharedPlayerInputMoverComponent.cs
@@ -1,4 +1,5 @@
-using System;
+#nullable enable
+using System;
using Content.Shared.GameObjects.Components.Mobs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
@@ -13,8 +14,6 @@ using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
-#nullable enable
-
namespace Content.Shared.GameObjects.Components.Movement
{
public abstract class SharedPlayerInputMoverComponent : Component, IMoverComponent, ICollideSpecial
diff --git a/Content.Shared/GameObjects/EntitySystems/SharedMoverSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedMoverSystem.cs
index 931648c5f1..29b65486a1 100644
--- a/Content.Shared/GameObjects/EntitySystems/SharedMoverSystem.cs
+++ b/Content.Shared/GameObjects/EntitySystems/SharedMoverSystem.cs
@@ -1,4 +1,5 @@
-using System.Diagnostics.CodeAnalysis;
+#nullable enable
+using System.Diagnostics.CodeAnalysis;
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Physics;
using Robust.Shared.Configuration;
@@ -15,8 +16,6 @@ using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Players;
-#nullable enable
-
namespace Content.Shared.GameObjects.EntitySystems
{
public abstract class SharedMoverSystem : EntitySystem
diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings
index 4eed2c94d7..5d7127034d 100644
--- a/SpaceStation14.sln.DotSettings
+++ b/SpaceStation14.sln.DotSettings
@@ -1,4 +1,6 @@
+ False
+ False
WARNING
WARNING
WARNING