Enable nullability in Content.Shared (#3626)

* Enable nullability in Content.Shared

* Fix null errors in server

* aye github i swear on me mom
This commit is contained in:
DrSmugleaf
2021-03-15 21:55:49 +01:00
committed by GitHub
parent 04201e944c
commit 6f012cb9ad
31 changed files with 167 additions and 117 deletions

View File

@@ -4,10 +4,8 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Broadphase;
@@ -40,7 +38,7 @@ namespace Content.Shared.GameObjects.EntitySystems
MapCoordinates origin,
MapCoordinates other,
int collisionMask = (int) CollisionGroup.Impassable,
Ignored predicate = null)
Ignored? predicate = null)
{
var dir = other.Position - origin.Position;
@@ -69,7 +67,7 @@ namespace Content.Shared.GameObjects.EntitySystems
MapCoordinates origin,
MapCoordinates other,
int collisionMask = (int) CollisionGroup.Impassable,
IEntity ignoredEnt = null)
IEntity? ignoredEnt = null)
{
var predicate = ignoredEnt == null
? null
@@ -111,7 +109,7 @@ namespace Content.Shared.GameObjects.EntitySystems
MapCoordinates other,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false)
{
if (!origin.InRange(other, range)) return false;
@@ -132,7 +130,7 @@ namespace Content.Shared.GameObjects.EntitySystems
foreach (var result in rayResults)
{
if (!result.HitEntity.TryGetComponent(out IPhysBody p))
if (!result.HitEntity.TryGetComponent(out IPhysBody? p))
{
continue;
}
@@ -186,7 +184,7 @@ namespace Content.Shared.GameObjects.EntitySystems
IEntity other,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -242,7 +240,7 @@ namespace Content.Shared.GameObjects.EntitySystems
IComponent other,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -298,7 +296,7 @@ namespace Content.Shared.GameObjects.EntitySystems
EntityCoordinates other,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -354,7 +352,7 @@ namespace Content.Shared.GameObjects.EntitySystems
MapCoordinates other,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -408,7 +406,7 @@ namespace Content.Shared.GameObjects.EntitySystems
ITargetedInteractEventArgs args,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -453,7 +451,7 @@ namespace Content.Shared.GameObjects.EntitySystems
DragDropEventArgs args,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{
@@ -521,7 +519,7 @@ namespace Content.Shared.GameObjects.EntitySystems
AfterInteractEventArgs args,
float range = InteractionRange,
CollisionGroup collisionMask = CollisionGroup.Impassable,
Ignored predicate = null,
Ignored? predicate = null,
bool ignoreInsideBlocker = false,
bool popup = false)
{