Fix foldables (#19717)

This commit is contained in:
Nemanja
2023-08-31 22:30:40 -04:00
committed by GitHub
parent 4cfc578011
commit f5d961e7be
6 changed files with 82 additions and 63 deletions

View File

@@ -3,6 +3,7 @@ using System.Linq;
using System.Numerics;
using Content.Shared.Body.Components;
using Content.Shared.Destructible;
using Content.Shared.Foldable;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Item;
@@ -130,6 +131,13 @@ public abstract class SharedEntityStorageSystem : EntitySystem
}
}
protected void OnFoldAttempt(EntityUid uid, SharedEntityStorageComponent component, ref FoldAttemptEvent args)
{
if (args.Cancelled)
return;
args.Cancelled = component.Open || component.Contents.ContainedEntities.Count != 0;
}
protected void AddToggleOpenVerb(EntityUid uid, SharedEntityStorageComponent component, GetVerbsEvent<InteractionVerb> args)
{
if (!args.CanAccess || !args.CanInteract)