Fix nearby warping (#9565)

This commit is contained in:
metalgearsloth
2022-07-09 15:20:23 +10:00
committed by GitHub
parent 18e7d80970
commit 53137cb527

View File

@@ -251,7 +251,8 @@ public sealed partial class ShuttleSystem
private bool TryHyperspaceDock(ShuttleComponent component, EntityUid targetUid)
{
if (!TryComp<TransformComponent>(component.Owner, out var xform) ||
!TryComp<TransformComponent>(targetUid, out var targetXform)) return false;
!TryComp<TransformComponent>(targetUid, out var targetXform) ||
targetXform.MapUid == null) return false;
var config = GetDockingConfig(component, targetUid);
@@ -291,7 +292,7 @@ public sealed partial class ShuttleSystem
shuttleBody.AngularVelocity = 0f;
}
xform.WorldPosition = spawnPos;
xform.Coordinates = new EntityCoordinates(targetXform.MapUid.Value, spawnPos);
xform.WorldRotation = _random.NextAngle();
return false;
}