Missing nullables (#8634)
This commit is contained in:
@@ -52,7 +52,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
var otherFixture = args.OtherFixture.Body.Owner;
|
||||
|
||||
if (!EntityManager.TryGetComponent(otherFixture, out FlammableComponent flammable))
|
||||
if (!EntityManager.TryGetComponent(otherFixture, out FlammableComponent? flammable))
|
||||
return;
|
||||
|
||||
flammable.FireStacks += component.FireStacks;
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Content.Server.Atmos.Monitor
|
||||
{
|
||||
public override void Execute(EntityUid uid)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent alarm))
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent? alarm))
|
||||
return;
|
||||
|
||||
foreach (var (addr, device) in alarm.DeviceData)
|
||||
@@ -110,7 +110,7 @@ namespace Content.Server.Atmos.Monitor
|
||||
{
|
||||
public override void Execute(EntityUid uid)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent alarm))
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent? alarm))
|
||||
return;
|
||||
|
||||
foreach (var (addr, device) in alarm.DeviceData)
|
||||
@@ -132,7 +132,7 @@ namespace Content.Server.Atmos.Monitor
|
||||
{
|
||||
public override void Execute(EntityUid uid)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent alarm))
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent? alarm))
|
||||
return;
|
||||
|
||||
foreach (var (addr, device) in alarm.DeviceData)
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.Atmos.Monitor
|
||||
{
|
||||
public override void Execute(EntityUid uid)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent alarm))
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent? alarm))
|
||||
return;
|
||||
|
||||
foreach (var (addr, device) in alarm.DeviceData)
|
||||
@@ -183,9 +183,9 @@ namespace Content.Server.Atmos.Monitor
|
||||
|
||||
public override void Execute(EntityUid uid)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent alarm)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosMonitorComponent monitor)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent alarmable))
|
||||
if (!EntityManager.TryGetComponent(uid, out AirAlarmComponent? alarm)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosMonitorComponent? monitor)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent? alarmable))
|
||||
return;
|
||||
|
||||
_devices = alarm.DeviceData;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
/// <param name="data">The data to send to the device.</param>
|
||||
public void SetData(EntityUid uid, string address, IAtmosDeviceData data)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent monitor)
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent? monitor)
|
||||
&& !monitor.NetEnabled)
|
||||
return;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
/// </summary>
|
||||
public void SyncAllDevices(EntityUid uid)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent monitor)
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent? monitor)
|
||||
&& !monitor.NetEnabled)
|
||||
return;
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
/// <param name="address">The address of the device.</param>
|
||||
public void SyncDevice(EntityUid uid, string address)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent monitor)
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent? monitor)
|
||||
&& !monitor.NetEnabled)
|
||||
return;
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
/// <param name="mode">The mode to sync with the rest of the network.</param>
|
||||
public void SyncMode(EntityUid uid, AirAlarmMode mode)
|
||||
{
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent monitor)
|
||||
if (EntityManager.TryGetComponent(uid, out AtmosMonitorComponent? monitor)
|
||||
&& !monitor.NetEnabled)
|
||||
return;
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out WiresComponent wire) && wire.IsPanelOpen)
|
||||
if (EntityManager.TryGetComponent(uid, out WiresComponent? wire) && wire.IsPanelOpen)
|
||||
{
|
||||
args.Handled = false;
|
||||
return;
|
||||
@@ -227,7 +227,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
private void OnUpdateAlarmMode(EntityUid uid, AirAlarmComponent component, AirAlarmUpdateAlarmModeMessage args)
|
||||
{
|
||||
string addr = string.Empty;
|
||||
if (EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn)) addr = netConn.Address;
|
||||
if (EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)) addr = netConn.Address;
|
||||
if (AccessCheck(uid, args.Session.AttachedEntity, component))
|
||||
SetMode(uid, addr, args.Mode, true, false);
|
||||
else
|
||||
@@ -255,7 +255,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
if (!Resolve(uid, ref component))
|
||||
return false;
|
||||
|
||||
if (!EntityManager.TryGetComponent(uid, out AccessReaderComponent reader) || user == null)
|
||||
if (!EntityManager.TryGetComponent(uid, out AccessReaderComponent? reader) || user == null)
|
||||
return false;
|
||||
|
||||
if (!_accessSystem.IsAllowed(user.Value, reader))
|
||||
@@ -276,7 +276,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
}
|
||||
|
||||
string addr = string.Empty;
|
||||
if (EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn)) addr = netConn.Address;
|
||||
if (EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)) addr = netConn.Address;
|
||||
|
||||
|
||||
if (args.HighestNetworkType == AtmosMonitorAlarmType.Danger)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
{
|
||||
if (component.IgnoreAlarms) return;
|
||||
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn))
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn))
|
||||
return;
|
||||
|
||||
if (args.Data.TryGetValue(DeviceNetworkConstants.Command, out string? cmd)
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
// the highest network alarm state at any time
|
||||
if (!args.Data.TryGetValue(DeviceNetworkConstants.Command, out string? cmd)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent? alarmable)
|
||||
|| !EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn))
|
||||
|| !EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn))
|
||||
return;
|
||||
|
||||
// ignore packets from self, ignore from different frequency
|
||||
@@ -342,7 +342,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
|
||||
if (state == AtmosMonitorAlarmType.Danger) PlayAlertSound(uid, monitor);
|
||||
|
||||
if (EntityManager.TryGetComponent(monitor.Owner, out AtmosAlarmableComponent alarmable)
|
||||
if (EntityManager.TryGetComponent(monitor.Owner, out AtmosAlarmableComponent? alarmable)
|
||||
&& !alarmable.IgnoreAlarms)
|
||||
RaiseLocalEvent(monitor.Owner, new AtmosMonitorAlarmEvent(monitor.LastAlarmState, monitor.HighestAlarmInNetwork));
|
||||
// TODO: Central system that grabs *all* alarms from wired network
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
private void OnCanisterChangeReleaseValve(EntityUid uid, GasCanisterComponent canister, GasCanisterChangeReleaseValveMessage args)
|
||||
{
|
||||
var impact = LogImpact.High;
|
||||
if (EntityManager.TryGetComponent(uid, out ContainerManagerComponent containerManager)
|
||||
if (EntityManager.TryGetComponent(uid, out ContainerManagerComponent? containerManager)
|
||||
&& containerManager.TryGetContainer(canister.ContainerName, out var container))
|
||||
impact = container.ContainedEntities.Count != 0 ? LogImpact.Medium : LogImpact.High;
|
||||
|
||||
|
||||
@@ -159,8 +159,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnPacketRecv(EntityUid uid, GasVentPumpComponent component, DeviceNetworkPacketEvent args)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent alarmable)
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent? alarmable)
|
||||
|| !args.Data.TryGetValue(DeviceNetworkConstants.Command, out var cmd))
|
||||
return;
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnPacketRecv(EntityUid uid, GasVentScrubberComponent component, DeviceNetworkPacketEvent args)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent alarmable)
|
||||
if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)
|
||||
|| !EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent? alarmable)
|
||||
|| !args.Data.TryGetValue(DeviceNetworkConstants.Command, out var cmd))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user