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

@@ -83,7 +83,7 @@ namespace Content.Server.Sandbox
}
}
private void OnPlayerStatusChanged(object sender, SessionStatusEventArgs e)
private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
{
if (e.NewStatus != SessionStatus.Connected || e.OldStatus != SessionStatus.Connecting)
{
@@ -123,14 +123,14 @@ namespace Content.Server.Sandbox
.EnumeratePrototypes<AccessLevelPrototype>()
.Select(p => p.ID).ToArray();
if (player.AttachedEntity.TryGetComponent(out InventoryComponent inv)
&& inv.TryGetSlotItem(Slots.IDCARD, out ItemComponent wornItem))
if (player.AttachedEntity.TryGetComponent(out InventoryComponent? inv)
&& inv.TryGetSlotItem(Slots.IDCARD, out ItemComponent? wornItem))
{
if (wornItem.Owner.HasComponent<AccessComponent>())
{
UpgradeId(wornItem.Owner);
}
else if (wornItem.Owner.TryGetComponent(out PDAComponent pda))
else if (wornItem.Owner.TryGetComponent(out PDAComponent? pda))
{
if (pda.ContainedID == null)
{
@@ -156,7 +156,7 @@ namespace Content.Server.Sandbox
var access = id.GetComponent<AccessComponent>();
access.SetTags(allAccess);
if (id.TryGetComponent(out SpriteComponent sprite))
if (id.TryGetComponent(out SpriteComponent? sprite))
{
sprite.LayerSetState(0, "gold");
}