From 80c353066e3c33e24816f1f7f31b114566e202b3 Mon Sep 17 00:00:00 2001 From: ThereDrD0 <88589686+ThereDrD0@users.noreply.github.com> Date: Thu, 1 Aug 2024 07:08:29 +0300 Subject: [PATCH] fix tape stuck (#527) --- .../_White/Jukebox/TapeCreatorSystem.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Content.Server/_White/Jukebox/TapeCreatorSystem.cs b/Content.Server/_White/Jukebox/TapeCreatorSystem.cs index eb03220917..d193a7a623 100644 --- a/Content.Server/_White/Jukebox/TapeCreatorSystem.cs +++ b/Content.Server/_White/Jukebox/TapeCreatorSystem.cs @@ -158,6 +158,21 @@ public sealed class TapeCreatorSystem : EntitySystem DirtyEntity(GetEntity(ev.TapeCreatorUid)); Dirty(insertedTape, tapeComponent); - _popup.PopupEntity("Запись мозговой активности завершена", tapeCreator); + Record(tapeCreator, tapeCreatorComponent, _popup, _container); + } + + private void Record( + EntityUid uid, + TapeCreatorComponent component, + SharedPopupSystem popupSystem, + SharedContainerSystem containerSystem) + { + containerSystem.EmptyContainer(component.TapeContainer, force: true); + + component.Recording = false; + component.InsertedTape = null; + + popupSystem.PopupEntity("Запись мозговой активности завершена", uid); + Dirty(uid, component); } }