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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user