From 7c24ee595d88872d1b82e03d510b622d12418202 Mon Sep 17 00:00:00 2001 From: A-Mironov <65418470+Alexnov33X@users.noreply.github.com> Date: Thu, 25 Dec 2025 20:56:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B0=D0=BA=D1=81=D0=B0=20?= =?UTF-8?q?=D0=9F=D0=9D=D0=A2=20+=20=D0=B5=D0=B3=D0=BE=20=D1=84=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=20=D1=88=D0=BA=D0=B0=D1=84=20(#3467)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Fax/FaxSystem.cs | 23 ++++++++++ Resources/Maps/_Sunrise/Station/centcomm.yml | 2 +- .../Storage/Closets/Lockers/lockers.yml | 14 +----- .../Storage/Closets/Lockers/lockers.yml | 43 +++++++++++++++++++ .../Command/nanotrasen_representative.yml | 1 - 5 files changed, 68 insertions(+), 15 deletions(-) diff --git a/Content.Server/Fax/FaxSystem.cs b/Content.Server/Fax/FaxSystem.cs index d0b22161bd..dd1340a22c 100644 --- a/Content.Server/Fax/FaxSystem.cs +++ b/Content.Server/Fax/FaxSystem.cs @@ -37,6 +37,7 @@ using Content.Shared.Ghost; using Content.Shared.Inventory; using Robust.Server.Containers; using Content.Server.Storage.EntitySystems; +using Content.Shared.Item; using Robust.Shared.Utility; // sunrise-end @@ -620,6 +621,28 @@ public sealed class FaxSystem : EntitySystem var entityToSpawn = printout.PrototypeId.Length == 0 ? component.PrintPaperId.ToString() : printout.PrototypeId; var printed = Spawn(entityToSpawn, Transform(uid).Coordinates); + // Sunrise-start - For portable faxes (items), attempt to add to inventory instead of dropping to floor + if (HasComp(uid)) + { + bool successfullyInserted = _container.TryGetContainingContainer(uid, out var parentContainer) && + _container.Insert(printed, parentContainer); + // 1. Try to insert into the container that holds the fax (e.g. backpack) + + // 2. If not suitable, try to put it in the fax's own storage (if it has one) + if (!successfullyInserted && _container.TryGetContainer(uid, "storagebase", out var container)) + { + if (_container.Insert(printed, container)) + successfullyInserted = true; + } + + // 3. Fallback: If we couldn't insert it anywhere, ensure it's on the grid/map (drop it) + // This handles cases where the fax is in a container but that container is full. + if (!successfullyInserted) + { + _transform.AttachToGridOrMap(printed); + } + } + // Sunrise-end if (TryComp(printed, out var paper)) { diff --git a/Resources/Maps/_Sunrise/Station/centcomm.yml b/Resources/Maps/_Sunrise/Station/centcomm.yml index ca6c9685ac..97d4da3ba8 100644 --- a/Resources/Maps/_Sunrise/Station/centcomm.yml +++ b/Resources/Maps/_Sunrise/Station/centcomm.yml @@ -11913,7 +11913,7 @@ entities: - type: Transform pos: -12.5,-9.5 parent: 2 -- proto: LockerRepresentative +- proto: LockerRepresentativeEmpty entities: - uid: 1552 components: diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml index 46531ab3fb..aefd44f2f3 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml @@ -688,16 +688,4 @@ stateDoorOpen: mime_open stateDoorClosed: mime_door -# Representative -- type: entity - id: LockerRepresentative - name: representative locker - parent: LockerBaseSecure - components: - - type: Appearance - - type: AccessReader - access: [["Ntrep"]] - - type: EntityStorageVisuals - stateBaseClosed: hop - stateDoorOpen: hop_open - stateDoorClosed: representative_door + diff --git a/Resources/Prototypes/_Sunrise/Entities/Structures/Storage/Closets/Lockers/lockers.yml b/Resources/Prototypes/_Sunrise/Entities/Structures/Storage/Closets/Lockers/lockers.yml index 1a2db53780..a6245d3924 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Structures/Storage/Closets/Lockers/lockers.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Structures/Storage/Closets/Lockers/lockers.yml @@ -202,3 +202,46 @@ prob: 0.1 - id: PKAUpgradeDamage prob: 0.1 + +# Representative +- type: entity + id: LockerRepresentative + name: representative locker + parent: LockerBaseSecure + components: + - type: Appearance + - type: AccessReader + access: [["Ntrep"]] + - type: EntityStorageVisuals + stateBaseClosed: hop + stateDoorOpen: hop_open + stateDoorClosed: representative_door + # Sunrise-start + - type: StorageFill + contents: + - id: HandheldFax + # Sunrise-end + +- type: entity + id: LockerRepresentativeEmpty + name: representative locker + parent: LockerBaseSecure + suffix: Empty + components: + - type: Appearance + - type: AccessReader + access: [["Ntrep"]] + - type: EntityStorageVisuals + stateBaseClosed: hop + stateDoorOpen: hop_open + stateDoorClosed: representative_door + +- type: entity + id: LockerRepresentativeFilled + parent: LockerRepresentative + suffix: Filled + # Sunrise-start + # This is now identical to the base LockerRepresentative, kept for compatibility/explicit usage + # Sunrise-end +#Fish-end + diff --git a/Resources/Prototypes/_Sunrise/Roles/Jobs/Command/nanotrasen_representative.yml b/Resources/Prototypes/_Sunrise/Roles/Jobs/Command/nanotrasen_representative.yml index 658a1ea689..7a904f610a 100644 --- a/Resources/Prototypes/_Sunrise/Roles/Jobs/Command/nanotrasen_representative.yml +++ b/Resources/Prototypes/_Sunrise/Roles/Jobs/Command/nanotrasen_representative.yml @@ -62,7 +62,6 @@ back: - RubberStampNtrep - CaneNT - - HandheldFax #sunrise-edit - RubberStampVeto #sunrise-edit - type: chameleonOutfit