Fixes storage eating buckled players (#9096)

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
Júlio César Ueti
2022-06-24 16:26:56 -03:00
committed by GitHub
parent 8761dec4e9
commit d1a0340343
4 changed files with 32 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ namespace Content.Server.Foldable
SubscribeLocalEvent<FoldableComponent, StorageOpenAttemptEvent>(OnFoldableOpenAttempt);
SubscribeLocalEvent<FoldableComponent, GetVerbsEvent<AlternativeVerb>>(AddFoldVerb);
SubscribeLocalEvent<FoldableComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
}
private void OnFoldableOpenAttempt(EntityUid uid, FoldableComponent component, StorageOpenAttemptEvent args)
@@ -86,6 +87,12 @@ namespace Content.Server.Foldable
strap.Enabled = !component.IsFolded;
}
public void OnEntityStorageInsertAttempt(EntityUid uid, FoldableComponent comp, InsertIntoEntityStorageAttemptEvent args)
{
if (!comp.IsFolded)
args.Cancel();
}
#region Verb
private void AddFoldVerb(EntityUid uid, FoldableComponent component, GetVerbsEvent<AlternativeVerb> args)