Replace MaybeNullWhen(false) with NotNullWhen(true)

This commit is contained in:
DrSmugleaf
2020-12-20 04:14:41 +01:00
parent f7edb9ce7e
commit 026d96fd2d
11 changed files with 41 additions and 48 deletions

View File

@@ -130,7 +130,7 @@ namespace Content.Server.GameObjects.Components.Atmos
// Already get the pressure before Dirty(), because we can't get the EntitySystem in that thread or smth
var pressure = 0f;
var gam = EntitySystem.Get<AtmosphereSystem>().GetGridAtmosphere(Owner.Transform.GridID);
var tile = gam?.GetTile(Owner.Transform.Coordinates).Air;
var tile = gam?.GetTile(Owner.Transform.Coordinates)?.Air;
if (tile != null)
{
pressure = tile.Pressure;
@@ -190,7 +190,7 @@ namespace Content.Server.GameObjects.Components.Atmos
var atmosSystem = EntitySystem.Get<AtmosphereSystem>();
var gam = atmosSystem.GetGridAtmosphere(pos.GetGridId(Owner.EntityManager));
var tile = gam?.GetTile(pos).Air;
var tile = gam.GetTile(pos)?.Air;
if (tile == null)
{
error = "No Atmosphere!";

View File

@@ -2,7 +2,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using Content.Server.Atmos;
@@ -10,7 +9,6 @@ using Content.Server.GameObjects.Components.Atmos.Piping;
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.GameObjects.EntitySystems.Atmos;
using Content.Shared;
using Content.Shared.Atmos;
using Content.Shared.Maps;
using Robust.Server.GameObjects.EntitySystems.TileLookup;
@@ -19,7 +17,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.ComponentDependencies;
using Robust.Shared.GameObjects.Components.Map;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.Configuration;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Log;
using Robust.Shared.Map;