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

@@ -1,5 +1,6 @@
using Content.Server.Buckle.Components;
using Content.Server.Interaction;
using Content.Server.Storage.Components;
using Content.Shared.Buckle;
using Content.Shared.Interaction;
using Content.Shared.Verbs;
@@ -32,6 +33,7 @@ namespace Content.Server.Buckle.Systems
SubscribeLocalEvent<BuckleComponent, InteractHandEvent>(HandleInteractHand);
SubscribeLocalEvent<BuckleComponent, GetVerbsEvent<InteractionVerb>>(AddUnbuckleVerb);
SubscribeLocalEvent<BuckleComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
}
private void AddUnbuckleVerb(EntityUid uid, BuckleComponent component, GetVerbsEvent<InteractionVerb> args)
@@ -133,5 +135,11 @@ namespace Content.Server.Buckle.Systems
buckle.ReAttach(strap);
}
}
public void OnEntityStorageInsertAttempt(EntityUid uid, BuckleComponent comp, InsertIntoEntityStorageAttemptEvent args)
{
if (comp.Buckled)
args.Cancel();
}
}
}