Enable nullability in Content.Server (#3685)
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.GameObjects.Components.Stack;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Items
|
||||
@@ -23,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
|
||||
public override string Name => "FloorTile";
|
||||
[DataField("outputs")]
|
||||
private List<string> _outputTiles;
|
||||
private List<string>? _outputTiles;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -55,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true))
|
||||
return true;
|
||||
|
||||
if (!Owner.TryGetComponent(out StackComponent stack))
|
||||
if (!Owner.TryGetComponent(out StackComponent? stack))
|
||||
return true;
|
||||
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
@@ -65,6 +63,10 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
if (locationMap.MapId == MapId.Nullspace)
|
||||
return true;
|
||||
mapManager.TryGetGrid(location.GetGridId(Owner.EntityManager), out var mapGrid);
|
||||
|
||||
if (_outputTiles == null)
|
||||
return true;
|
||||
|
||||
foreach (var currentTile in _outputTiles)
|
||||
{
|
||||
var currentTileDefinition = (ContentTileDefinition) _tileDefinitionManager[currentTile];
|
||||
|
||||
Reference in New Issue
Block a user