Adds portable flasher (#4523)

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
ScalyChimp
2022-02-06 15:59:41 +00:00
committed by GitHub
parent ff8ebf1896
commit 3c9328ff99
14 changed files with 441 additions and 27 deletions

View File

@@ -30,6 +30,7 @@ namespace Content.Shared.Pulling
public class SharedPullingStateManagementSystem : EntitySystem
{
[Dependency] private readonly SharedJointSystem _jointSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
public override void Initialize()
{
@@ -116,7 +117,7 @@ namespace Content.Shared.Pulling
pullable.Puller = puller.Owner;
// Joint startup
var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB());
var union = _physics.GetHardAABB(pullerPhysics).Union(_physics.GetHardAABB(pullablePhysics));
var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f;
pullable.PullJoint = _jointSystem.CreateDistanceJoint(pullablePhysics.Owner, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}");