Nullability fixes.
This commit is contained in:
@@ -112,7 +112,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
/// </summary>
|
||||
private void BuckleStatus()
|
||||
{
|
||||
if (Owner.TryGetComponent(out ServerStatusEffectsComponent status))
|
||||
if (Owner.TryGetComponent(out ServerStatusEffectsComponent? status))
|
||||
{
|
||||
status.ChangeStatusEffectIcon(StatusEffect.Buckled,
|
||||
Buckled
|
||||
@@ -291,7 +291,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(BuckleVisuals.Buckled, true);
|
||||
}
|
||||
@@ -359,12 +359,12 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
Owner.Transform.WorldRotation = oldBuckledTo.Owner.Transform.WorldRotation;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(BuckleVisuals.Buckled, false);
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out StunnableComponent stunnable) && stunnable.KnockedDown)
|
||||
if (Owner.TryGetComponent(out StunnableComponent? stunnable) && stunnable.KnockedDown)
|
||||
{
|
||||
StandingStateHelper.Down(Owner);
|
||||
}
|
||||
@@ -373,14 +373,14 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
StandingStateHelper.Standing(Owner);
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out MobStateManagerComponent stateManager))
|
||||
if (Owner.TryGetComponent(out MobStateManagerComponent? stateManager))
|
||||
{
|
||||
stateManager.CurrentMobState.EnterState(Owner);
|
||||
}
|
||||
|
||||
BuckleStatus();
|
||||
|
||||
if (oldBuckledTo.Owner.TryGetComponent(out StrapComponent strap))
|
||||
if (oldBuckledTo.Owner.TryGetComponent(out StrapComponent? strap))
|
||||
{
|
||||
strap.Remove(this);
|
||||
_entitySystem.GetEntitySystem<AudioSystem>()
|
||||
@@ -535,7 +535,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
_entityManager.EventBus.UnsubscribeEvents(this);
|
||||
|
||||
if (BuckledTo != null &&
|
||||
BuckledTo.Owner.TryGetComponent(out StrapComponent strap))
|
||||
BuckledTo.Owner.TryGetComponent(out StrapComponent? strap))
|
||||
{
|
||||
strap.Remove(this);
|
||||
}
|
||||
@@ -552,7 +552,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
||||
|
||||
if (BuckledTo != null &&
|
||||
Owner.Transform.WorldRotation.GetCardinalDir() == Direction.North &&
|
||||
BuckledTo.Owner.TryGetComponent(out SpriteComponent strapSprite))
|
||||
BuckledTo.Owner.TryGetComponent(out SpriteComponent? strapSprite))
|
||||
{
|
||||
drawDepth = strapSprite.DrawDepth - 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user