]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add whitelist to cryostorage (#30574)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Tue, 6 Aug 2024 11:00:15 +0000 (13:00 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Aug 2024 11:00:15 +0000 (21:00 +1000)
Content.Shared/Bed/Cryostorage/CanEnterCryostorageComponent.cs [new file with mode: 0644]
Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Resources/Prototypes/Entities/Mobs/Species/base.yml

diff --git a/Content.Shared/Bed/Cryostorage/CanEnterCryostorageComponent.cs b/Content.Shared/Bed/Cryostorage/CanEnterCryostorageComponent.cs
new file mode 100644 (file)
index 0000000..2e5b200
--- /dev/null
@@ -0,0 +1,10 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Bed.Cryostorage;
+
+/// <summary>
+/// Serves as a whitelist that allows an entity with this component to enter cryostorage.
+/// It will also require MindContainerComponent.
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class CanEnterCryostorageComponent : Component { }
index c3fa21e293e2d2ddf463055b2bad376786dcb18a..f6b7a34785294484623625880a953cfeac75a5ab 100644 (file)
@@ -89,7 +89,7 @@ public abstract class SharedCryostorageSystem : EntitySystem
             return;
         }
 
-        if (!TryComp<MindContainerComponent>(args.EntityUid, out var mindContainer))
+        if (!HasComp<CanEnterCryostorageComponent>(args.EntityUid) || !TryComp<MindContainerComponent>(args.EntityUid, out var mindContainer))
         {
             args.Cancel();
             return;
index af309e93adda9f9589e248cda4daadac82841f31..4a14b5332ec811bfc3777dcaf1e30ffa7d3be74a 100644 (file)
   - type: Dna
   - type: MindContainer
     showExamineInfo: true
+  - type: CanEnterCryostorage
   - type: InteractionPopup
     successChance: 1
     interactSuccessString: hugging-success-generic