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

@@ -3,8 +3,6 @@ using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
namespace Content.Client.GameObjects.Components.Atmos
{
@@ -13,12 +11,15 @@ namespace Content.Client.GameObjects.Components.Atmos
{
[DataField("fireStackAlternateState")]
private int _fireStackAlternateState = 3;
[DataField("normalState")]
private string _normalState;
private string? _normalState;
[DataField("alternateState")]
private string _alternateState;
private string? _alternateState;
[DataField("sprite")]
private string _sprite;
private string? _sprite;
public override void InitializeEntity(IEntity entity)
{
@@ -49,7 +50,11 @@ namespace Content.Client.GameObjects.Components.Atmos
{
var sprite = component.Owner.GetComponent<ISpriteComponent>();
sprite.LayerSetRSI(FireVisualLayers.Fire, _sprite);
if (_sprite != null)
{
sprite.LayerSetRSI(FireVisualLayers.Fire, _sprite);
}
sprite.LayerSetVisible(FireVisualLayers.Fire, onFire);
if(fireStacks > _fireStackAlternateState && !string.IsNullOrEmpty(_alternateState))