Makes a lot of entity systems unsubscribe from events on shutdown.
This commit is contained in:
@@ -27,6 +27,17 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
SubscribeLocalEvent<BuckleComponent, AttackHandMessage>(HandleAttackHand);
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
UnsubscribeLocalEvent<MoveEvent>();
|
||||
UnsubscribeLocalEvent<EntInsertedIntoContainerMessage>();
|
||||
UnsubscribeLocalEvent<EntRemovedFromContainerMessage>();
|
||||
|
||||
UnsubscribeLocalEvent<BuckleComponent, AttackHandMessage>(HandleAttackHand);
|
||||
}
|
||||
|
||||
private void HandleAttackHand(EntityUid uid, BuckleComponent component, AttackHandMessage args)
|
||||
{
|
||||
args.Handled = component.TryUnbuckle(args.User);
|
||||
@@ -40,14 +51,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
UnsubscribeLocalEvent<MoveEvent>();
|
||||
UnsubscribeLocalEvent<BuckleComponent, AttackHandMessage>(HandleAttackHand);
|
||||
}
|
||||
|
||||
private void MoveEvent(MoveEvent ev)
|
||||
{
|
||||
if (!ev.Sender.TryGetComponent(out BuckleComponent? buckle))
|
||||
|
||||
Reference in New Issue
Block a user