Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -6,6 +6,7 @@ using JetBrains.Annotations;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Observer.GhostRoles
@@ -33,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Observer.GhostRoles
[CanBeNull]
[ViewVariables(VVAccess.ReadWrite)]
[DataField("prototype")]
public string Prototype { get; private set; }
public string? Prototype { get; private set; }
public override bool Take(IPlayerSession session)
{
@@ -50,7 +51,11 @@ namespace Content.Server.GameObjects.Components.Observer.GhostRoles
mob.EnsureComponent<MindComponent>();
session.ContentData().Mind.TransferTo(mob);
var mind = session.ContentData()?.Mind;
DebugTools.AssertNotNull(mind);
mind!.TransferTo(mob);
if (++_currentTakeovers < _availableTakeovers) return true;