Fix buckle component exception when Removed from entity.

This commit is contained in:
Vera Aguilera Puerto
2021-10-01 13:15:30 +02:00
parent 47107c6a42
commit facb0358f5

View File

@@ -334,7 +334,7 @@ namespace Content.Server.Buckle.Components
Appearance?.SetData(BuckleVisuals.Buckled, false);
if (_stunnable != null && _stunnable.KnockedDown
if (_stunnable is { KnockedDown: true }
|| (_mobState?.IsIncapacitated() ?? false))
{
EntitySystem.Get<StandingStateSystem>().Down(Owner);
@@ -386,7 +386,7 @@ namespace Content.Server.Buckle.Components
UpdateBuckleStatus();
}
protected override void OnRemove()
protected override void Shutdown()
{
BuckledTo?.Remove(this);
TryUnbuckle(Owner, true);
@@ -394,7 +394,7 @@ namespace Content.Server.Buckle.Components
_buckleTime = default;
UpdateBuckleStatus();
base.OnRemove();
base.Shutdown();
}
public override ComponentState GetComponentState(ICommonSession player)