Skip to content

Commit

Permalink
Add whitelist to cryostorage (#30574)
Browse files Browse the repository at this point in the history
  • Loading branch information
slarticodefast authored and sleepyyapril committed Jan 16, 2025
1 parent 09fa40f commit d193be9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Content.Shared/Bed/Cryostorage/CanEnterCryostorageComponent.cs
Original file line number Diff line number Diff line change
@@ -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 { }
2 changes: 1 addition & 1 deletion Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void OnInsertAttempt(Entity<CryostorageComponent> ent, ref ContainerIsIn
return;
}

if (!TryComp<MindContainerComponent>(args.EntityUid, out var mindContainer))
if (!HasComp<CanEnterCryostorageComponent>(args.EntityUid) || !TryComp<MindContainerComponent>(args.EntityUid, out var mindContainer))
{
args.Cancel();
return;
Expand Down
6 changes: 6 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Species/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
- type: Scent
- type: MindContainer
showExamineInfo: true
- type: CanEnterCryostorage
- type: InteractionPopup
successChance: 1
interactSuccessString: hugging-success-generic
interactSuccessSound: /Audio/Effects/thudswoosh.ogg
messagePerceivedByOthers: hugging-success-generic-others
- type: CanHostGuardian
- type: NpcFactionMember
factions:
Expand Down

0 comments on commit d193be9

Please sign in to comment.