Pathfinder rework (#11452)

This commit is contained in:
metalgearsloth
2022-09-30 14:39:48 +10:00
committed by GitHub
parent fd3b29fb03
commit f456ad911e
80 changed files with 3606 additions and 4374 deletions

View File

@@ -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,