From e68d3786b8d9bce1da65b9969d968c0d05c0c54e Mon Sep 17 00:00:00 2001 From: Artur Zhidkov Date: Tue, 27 Jun 2023 19:54:48 +0300 Subject: [PATCH] Photocopier: Added dereferencing on component shutdown --- Content.Server/SS220/Photocopier/PhotocopierSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Server/SS220/Photocopier/PhotocopierSystem.cs b/Content.Server/SS220/Photocopier/PhotocopierSystem.cs index 4f7c700f3b7047..f904e411e37538 100644 --- a/Content.Server/SS220/Photocopier/PhotocopierSystem.cs +++ b/Content.Server/SS220/Photocopier/PhotocopierSystem.cs @@ -51,6 +51,7 @@ public override void Initialize() SubscribeLocalEvent(OnItemSlotChanged); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnCollisionChanged); + SubscribeLocalEvent(OnShutdown); // UI SubscribeLocalEvent(OnToggleInterface); @@ -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,