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

@@ -4,9 +4,7 @@ using Content.Shared.Interfaces;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -26,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
private void TryRotate(IEntity user, Angle angle)
{
if (!RotateWhileAnchored && Owner.TryGetComponent(out IPhysBody physics))
if (!RotateWhileAnchored && Owner.TryGetComponent(out IPhysBody? physics))
{
if (physics.BodyType == BodyType.Static)
{
@@ -43,7 +41,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
{
protected override void GetData(IEntity user, RotatableComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user) || (!component.RotateWhileAnchored && component.Owner.TryGetComponent(out IPhysBody physics) && physics.BodyType == BodyType.Static))
if (!ActionBlockerSystem.CanInteract(user) || (!component.RotateWhileAnchored && component.Owner.TryGetComponent(out IPhysBody? physics) && physics.BodyType == BodyType.Static))
{
data.Visibility = VerbVisibility.Invisible;
return;
@@ -65,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
{
protected override void GetData(IEntity user, RotatableComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user) || (!component.RotateWhileAnchored && component.Owner.TryGetComponent(out IPhysBody physics) && physics.BodyType == BodyType.Static))
if (!ActionBlockerSystem.CanInteract(user) || (!component.RotateWhileAnchored && component.Owner.TryGetComponent(out IPhysBody? physics) && physics.BodyType == BodyType.Static))
{
data.Visibility = VerbVisibility.Invisible;
return;