Add whitelist to cryostorage (#30574)

This commit is contained in:
slarticodefast
2024-08-06 13:00:15 +02:00
committed by GitHub
parent 4426ce123a
commit 7117b925a5
3 changed files with 12 additions and 1 deletions

View File

@@ -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 { }

View 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;

View File

@@ -167,6 +167,7 @@
- type: Dna
- type: MindContainer
showExamineInfo: true
- type: CanEnterCryostorage
- type: InteractionPopup
successChance: 1
interactSuccessString: hugging-success-generic