Hotfix buckle teleports (#11950)

This commit is contained in:
metalgearsloth
2022-10-16 17:38:04 +11:00
committed by GitHub
parent 5b0dfffec0
commit 3d8a2adbf8

View File

@@ -2,6 +2,7 @@ using Content.Shared.DragDrop;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Standing; using Content.Shared.Standing;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.Buckle.Components namespace Content.Shared.Buckle.Components
@@ -48,7 +49,13 @@ namespace Content.Shared.Buckle.Components
var ownTransform = EntMan.GetComponent<TransformComponent>(Owner); var ownTransform = EntMan.GetComponent<TransformComponent>(Owner);
var strapTransform = EntMan.GetComponent<TransformComponent>(strap.Owner); var strapTransform = EntMan.GetComponent<TransformComponent>(strap.Owner);
ownTransform.AttachParent(strapTransform); ownTransform.Coordinates = new EntityCoordinates(strapTransform.Owner, strap.BuckleOffset);
// Buckle subscribes to move for <reasons> so this might fail.
// TODO: Make buckle not do that.
if (ownTransform.ParentUid != strapTransform.Owner)
return;
ownTransform.LocalRotation = Angle.Zero; ownTransform.LocalRotation = Angle.Zero;
switch (strap.Position) switch (strap.Position)
@@ -62,8 +69,6 @@ namespace Content.Shared.Buckle.Components
EntitySystem.Get<StandingStateSystem>().Down(Owner, false, false); EntitySystem.Get<StandingStateSystem>().Down(Owner, false, false);
break; break;
} }
ownTransform.LocalPosition = strap.BuckleOffset;
} }
} }