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

@@ -38,7 +38,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void PlayWeaponArc(PlayMeleeWeaponAnimationMessage msg)
{
if (!_prototypeManager.TryIndex(msg.ArcPrototype, out MeleeWeaponAnimationPrototype weaponArc))
if (!_prototypeManager.TryIndex(msg.ArcPrototype, out MeleeWeaponAnimationPrototype? weaponArc))
{
Logger.Error("Tried to play unknown weapon arc prototype '{0}'", msg.ArcPrototype);
return;
@@ -63,8 +63,10 @@ namespace Content.Client.GameObjects.EntitySystems
weaponArcAnimation.SetData(weaponArc, msg.Angle, attacker, msg.ArcFollowAttacker);
// Due to ISpriteComponent limitations, weapons that don't use an RSI won't have this effect.
if (EntityManager.TryGetEntity(msg.Source, out var source) && msg.TextureEffect && source.TryGetComponent(out ISpriteComponent sourceSprite)
&& sourceSprite.BaseRSI?.Path != null)
if (EntityManager.TryGetEntity(msg.Source, out var source) &&
msg.TextureEffect &&
source.TryGetComponent(out ISpriteComponent? sourceSprite) &&
sourceSprite.BaseRSI?.Path != null)
{
var sys = Get<EffectSystem>();
var curTime = _gameTiming.CurTime;
@@ -91,7 +93,7 @@ namespace Content.Client.GameObjects.EntitySystems
continue;
}
if (!hitEntity.TryGetComponent(out ISpriteComponent sprite))
if (!hitEntity.TryGetComponent(out ISpriteComponent? sprite))
{
continue;
}