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