Skip to content

Commit

Permalink
Broadcast MoveEvent -> C# event (space-wizards#22689)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirrorcult authored Dec 19, 2023
1 parent a4ed13a commit 340c178
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void InitializeGrid()
SubscribeLocalEvent<CollisionLayerChangeEvent>(OnCollisionLayerChange);
SubscribeLocalEvent<PhysicsBodyTypeChangedEvent>(OnBodyTypeChange);
SubscribeLocalEvent<TileChangedEvent>(OnTileChange);
SubscribeLocalEvent<MoveEvent>(OnMoveEvent);
_transform.OnGlobalMoveEvent += OnMoveEvent;
}

private void OnTileChange(ref TileChangedEvent ev)
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/NPC/Pathfinding/PathfindingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public sealed partial class PathfindingSystem : SharedPathfindingSystem
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly NPCSystem _npc = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

private readonly Dictionary<ICommonSession, PathfindingDebugMode> _subscribedSessions = new();

Expand Down Expand Up @@ -75,6 +76,7 @@ public override void Shutdown()
base.Shutdown();
_subscribedSessions.Clear();
_playerManager.PlayerStatusChanged -= OnPlayerChange;
_transform.OnGlobalMoveEvent -= OnMoveEvent;
}

public override void Update(float frameTime)
Expand Down

0 comments on commit 340c178

Please sign in to comment.