misc optimization (#6436)

This commit is contained in:
Leon Friedrich
2022-02-03 18:40:22 +13:00
committed by GitHub
parent 19ceda04b5
commit 0da74b1bfb
7 changed files with 138 additions and 15 deletions

View File

@@ -31,6 +31,19 @@ namespace Content.Shared.Pulling
{
[Dependency] private readonly SharedJointSystem _jointSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedPullableComponent, ComponentShutdown>(OnShutdown);
}
private void OnShutdown(EntityUid uid, SharedPullableComponent component, ComponentShutdown args)
{
if (component.Puller != null)
ForceRelationship(null, component);
}
// A WARNING:
// The following 2 functions are the most internal part of the pulling system's relationship management.
// They do not expect to be cancellable.