fix inventory escape bug (#12695)

This commit is contained in:
Rane 2022-11-20 22:34:53 -05:00 committed by GitHub
parent d6bfd1288d
commit a47f847659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -31,7 +31,6 @@ public sealed class EscapeInventorySystem : EntitySystem
base.Initialize(); base.Initialize();
SubscribeLocalEvent<CanEscapeInventoryComponent, MoveInputEvent>(OnRelayMovement); SubscribeLocalEvent<CanEscapeInventoryComponent, MoveInputEvent>(OnRelayMovement);
SubscribeLocalEvent<CanEscapeInventoryComponent, UpdateCanMoveEvent>(OnMoveAttempt);
SubscribeLocalEvent<CanEscapeInventoryComponent, EscapeDoAfterComplete>(OnEscapeComplete); SubscribeLocalEvent<CanEscapeInventoryComponent, EscapeDoAfterComplete>(OnEscapeComplete);
SubscribeLocalEvent<CanEscapeInventoryComponent, EscapeDoAfterCancel>(OnEscapeFail); SubscribeLocalEvent<CanEscapeInventoryComponent, EscapeDoAfterCancel>(OnEscapeFail);
SubscribeLocalEvent<CanEscapeInventoryComponent, DroppedEvent>(OnDropped); SubscribeLocalEvent<CanEscapeInventoryComponent, DroppedEvent>(OnDropped);
@ -68,12 +67,6 @@ public sealed class EscapeInventorySystem : EntitySystem
AttemptEscape(uid, container.Owner, component); AttemptEscape(uid, container.Owner, component);
} }
private void OnMoveAttempt(EntityUid uid, CanEscapeInventoryComponent component, UpdateCanMoveEvent args)
{
if (_containerSystem.IsEntityOrParentInContainer(uid))
args.Cancel();
}
private void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f) private void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
{ {
component.CancelToken = new(); component.CancelToken = new();