Properly fix chair collision & disallow pulling objects you're buckled to (#3241)

Co-authored-by: cyclowns <cyclowns@protonmail.ch>
This commit is contained in:
mirrorcult
2021-02-16 01:42:03 -07:00
committed by GitHub
parent 372d994f16
commit 1ab8d3e6e9
3 changed files with 52 additions and 31 deletions

View File

@@ -263,11 +263,20 @@ namespace Content.Server.GameObjects.Components.Buckle
SendMessage(new BuckleMessage(Owner, to));
if (Owner.TryGetComponent(out PullableComponent? pullableComponent))
if (Owner.TryGetComponent(out PullableComponent? ownerPullable))
{
if (pullableComponent.Puller != null)
if (ownerPullable.Puller != null)
{
pullableComponent.TryStopPull();
ownerPullable.TryStopPull();
}
}
if (to.TryGetComponent(out PullableComponent? toPullable))
{
if (toPullable.Puller == Owner)
{
// can't pull it and buckle to it at the same time
toPullable.TryStopPull();
}
}