Skip to content

Commit

Permalink
Photocopier: Added dereferencing on component shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
TheArturZh committed Jun 27, 2023
1 parent a1c0652 commit e68d378
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Content.Server/SS220/Photocopier/PhotocopierSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public override void Initialize()
SubscribeLocalEvent<PhotocopierComponent, EntRemovedFromContainerMessage>(OnItemSlotChanged);
SubscribeLocalEvent<PhotocopierComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<PhotocopierComponent, ShapeCollisionTrackerUpdatedEvent>(OnCollisionChanged);
SubscribeLocalEvent<PhotocopierComponent, ComponentShutdown>(OnShutdown);

// UI
SubscribeLocalEvent<PhotocopierComponent, AfterActivatableUIOpenEvent>(OnToggleInterface);
Expand Down Expand Up @@ -105,6 +106,13 @@ private void OnComponentRemove(EntityUid uid, PhotocopierComponent component, Co
_itemSlots.RemoveItemSlot(uid, component.TonerSlot);
}

private void OnShutdown(EntityUid uid, PhotocopierComponent component, ComponentShutdown args)
{
component.EntityOnTop = null;
component.HumanoidAppearanceOnTop = null;
component.PrintAudioStream = null;
}

private void OnCollisionChanged(
EntityUid uid,
PhotocopierComponent component,
Expand Down

0 comments on commit e68d378

Please sign in to comment.