Enable nullability in Content.Client (#3257)

* Enable nullability in Content.Client

* Remove #nullable enable

* Merge fixes

* Remove Debug.Assert

* Merge fixes

* Fix build

* Fix build
This commit is contained in:
DrSmugleaf
2021-03-10 14:48:29 +01:00
committed by GitHub
parent 4f9bd4e802
commit 902aa128c2
270 changed files with 1774 additions and 1550 deletions

View File

@@ -1,4 +1,4 @@
using Content.Client.GameObjects.Components.ActionBlocking;
using Content.Client.GameObjects.Components.ActionBlocking;
using Content.Shared.GameObjects.Components.Body;
using Content.Shared.GameObjects.Components.Body.Part;
using Content.Shared.GameObjects.Components.Mobs;
@@ -42,16 +42,16 @@ namespace Content.Client.GameObjects.Components.Mobs
private void UpdateLooks()
{
if (Appearance is null ||
!Owner.TryGetComponent(out SpriteComponent sprite))
!Owner.TryGetComponent(out SpriteComponent? sprite))
{
return;
}
if (Owner.TryGetComponent(out IBody body))
if (Owner.TryGetComponent(out IBody? body))
{
foreach (var part in body.Parts.Values)
{
if (!part.Owner.TryGetComponent(out SpriteComponent partSprite))
if (!part.Owner.TryGetComponent(out SpriteComponent? partSprite))
{
continue;
}
@@ -94,12 +94,12 @@ namespace Content.Client.GameObjects.Components.Mobs
public void BodyPartAdded(BodyPartAddedEventArgs args)
{
if (!Owner.TryGetComponent(out SpriteComponent sprite))
if (!Owner.TryGetComponent(out SpriteComponent? sprite))
{
return;
}
if (!args.Part.Owner.TryGetComponent(out SpriteComponent partSprite))
if (!args.Part.Owner.TryGetComponent(out SpriteComponent? partSprite))
{
return;
}
@@ -117,12 +117,12 @@ namespace Content.Client.GameObjects.Components.Mobs
public void BodyPartRemoved(BodyPartRemovedEventArgs args)
{
if (!Owner.TryGetComponent(out SpriteComponent sprite))
if (!Owner.TryGetComponent(out SpriteComponent? sprite))
{
return;
}
if (!args.Part.Owner.TryGetComponent(out SpriteComponent partSprite))
if (!args.Part.Owner.TryGetComponent(out SpriteComponent? partSprite))
{
return;
}