Fix docking fallback (#25854)

Only thing that even triggers it atm is escape pods.
This commit is contained in:
metalgearsloth
2024-03-05 18:07:17 +11:00
committed by GitHub
parent 926b1407f6
commit bbb78807c4

View File

@@ -448,16 +448,12 @@ public sealed partial class ShuttleSystem
!HasComp<MapComponent>(target.EntityId)) !HasComp<MapComponent>(target.EntityId))
{ {
var config = _dockSystem.GetDockingConfigAt(uid, target.EntityId, target, entity.Comp1.TargetAngle); var config = _dockSystem.GetDockingConfigAt(uid, target.EntityId, target, entity.Comp1.TargetAngle);
MapCoordinates mapCoordinates; var mapCoordinates = _transform.ToMapCoordinates(target);
Angle targetAngle;
mapCoordinates = _transform.ToMapCoordinates(target);
// Couldn't dock somehow so just fallback to regular position FTL. // Couldn't dock somehow so just fallback to regular position FTL.
if (config == null) if (config == null)
{ {
targetAngle = entity.Comp1.TargetAngle; TryFTLProximity(uid, target.EntityId);
target = new EntityCoordinates(_mapManager.GetMapEntityId(mapCoordinates.MapId), mapCoordinates.Position);
_transform.SetCoordinates(uid, xform, target, rotation: targetAngle);
} }
else else
{ {