Replace CanBeNull annotations with question marks

This commit is contained in:
DrSmugleaf
2020-07-04 13:51:14 +02:00
parent 2691d34d5c
commit 0f16b9b8f1

View File

@@ -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.GameObjects.EntitySystems;
using Content.Server.Interfaces; using Content.Server.Interfaces;
using Content.Server.Mobs; using Content.Server.Mobs;
@@ -7,14 +8,11 @@ using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Mobs; using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Strap; using Content.Shared.GameObjects.Components.Strap;
using Content.Shared.GameObjects.EntitySystems; using Content.Shared.GameObjects.EntitySystems;
using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.EntitySystems; using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
@@ -27,15 +25,15 @@ namespace Content.Server.GameObjects.Components.Mobs
public class BuckleComponent : SharedBuckleComponent, IInteractHand public class BuckleComponent : SharedBuckleComponent, IInteractHand
{ {
#pragma warning disable 649 #pragma warning disable 649
[Dependency] private readonly IEntitySystemManager _entitySystem; [Dependency] private readonly IEntitySystemManager _entitySystem = default!;
[Dependency] private readonly IServerNotifyManager _notifyManager; [Dependency] private readonly IServerNotifyManager _notifyManager = default!;
#pragma warning restore 649 #pragma warning restore 649
[CanBeNull] private StrapComponent _buckledTo; private StrapComponent? _buckledTo;
private int _size; private int _size;
[ViewVariables, CanBeNull] [ViewVariables]
public StrapComponent BuckledTo public StrapComponent? BuckledTo
{ {
get => _buckledTo; get => _buckledTo;
private set private set
@@ -87,7 +85,7 @@ namespace Content.Server.GameObjects.Components.Mobs
return false; return false;
} }
if (!user.TryGetComponent(out HandsComponent hands)) if (!user.HasComponent<HandsComponent>())
{ {
_notifyManager.PopupMessage(user, user, _notifyManager.PopupMessage(user, user,
Loc.GetString("You don't have hands!")); Loc.GetString("You don't have hands!"));