Fix certain foldable items not being possible to store in crates/lockers (#36625)

Remove OnStoreThisAttempt
This commit is contained in:
SlamBamActionman
2025-04-16 13:54:42 +02:00
committed by GitHub
parent b1c08582d5
commit 0da8984431

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Utility;
namespace Content.Shared.Foldable; namespace Content.Shared.Foldable;
// TODO: This system could arguably be refactored into a general state system, as it is being utilized for a lot of different objects with various needs.
public sealed class FoldableSystem : EntitySystem public sealed class FoldableSystem : EntitySystem
{ {
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
@@ -24,7 +25,6 @@ public sealed class FoldableSystem : EntitySystem
SubscribeLocalEvent<FoldableComponent, ComponentInit>(OnFoldableInit); SubscribeLocalEvent<FoldableComponent, ComponentInit>(OnFoldableInit);
SubscribeLocalEvent<FoldableComponent, ContainerGettingInsertedAttemptEvent>(OnInsertEvent); SubscribeLocalEvent<FoldableComponent, ContainerGettingInsertedAttemptEvent>(OnInsertEvent);
SubscribeLocalEvent<FoldableComponent, InsertIntoEntityStorageAttemptEvent>(OnStoreThisAttempt);
SubscribeLocalEvent<FoldableComponent, StorageOpenAttemptEvent>(OnFoldableOpenAttempt); SubscribeLocalEvent<FoldableComponent, StorageOpenAttemptEvent>(OnFoldableOpenAttempt);
SubscribeLocalEvent<FoldableComponent, StrapAttemptEvent>(OnStrapAttempt); SubscribeLocalEvent<FoldableComponent, StrapAttemptEvent>(OnStrapAttempt);
@@ -46,12 +46,6 @@ public sealed class FoldableSystem : EntitySystem
args.Cancelled = true; args.Cancelled = true;
} }
public void OnStoreThisAttempt(EntityUid uid, FoldableComponent comp, ref InsertIntoEntityStorageAttemptEvent args)
{
if (comp.IsFolded)
args.Cancelled = true;
}
public void OnStrapAttempt(EntityUid uid, FoldableComponent comp, ref StrapAttemptEvent args) public void OnStrapAttempt(EntityUid uid, FoldableComponent comp, ref StrapAttemptEvent args)
{ {
if (comp.IsFolded) if (comp.IsFolded)