Pathfinder rework (#11452)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Server.Doors.Systems;
|
||||
using Content.Server.NPC.Pathfinding;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Shared.Doors;
|
||||
@@ -24,6 +25,7 @@ namespace Content.Server.Shuttles.Systems
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
|
||||
[Dependency] private readonly DoorSystem _doorSystem = default!;
|
||||
[Dependency] private readonly PathfindingSystem _pathfinding = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
private const string DockingFixture = "docking";
|
||||
@@ -136,6 +138,7 @@ namespace Content.Server.Shuttles.Systems
|
||||
|
||||
private void Cleanup(DockingComponent dockA)
|
||||
{
|
||||
_pathfinding.RemovePortal(dockA.PathfindHandle);
|
||||
_jointSystem.RemoveJoint(dockA.DockJoint!);
|
||||
|
||||
var dockBUid = dockA.DockedWith;
|
||||
@@ -369,6 +372,12 @@ namespace Content.Server.Shuttles.Systems
|
||||
_doorSystem.StartOpening(doorB.Owner, doorB);
|
||||
}
|
||||
|
||||
if (_pathfinding.TryCreatePortal(dockAXform.Coordinates, dockBXform.Coordinates, out var handle))
|
||||
{
|
||||
dockA.PathfindHandle = handle;
|
||||
dockB.PathfindHandle = handle;
|
||||
}
|
||||
|
||||
var msg = new DockEvent
|
||||
{
|
||||
DockA = dockA,
|
||||
|
||||
Reference in New Issue
Block a user