Fixes storage eating buckled players (#9096)
Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user