Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete functions in GridFixtureSystem #5484

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Robust.Server/Physics/GridFixtureSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private void CheckSplits(EntityUid uid, HashSet<ChunkSplitNode> dirtyNodes)
foreach (var index in node.Indices)
{
var tilePos = offset + index;
tileData.Add((tilePos, oldGrid.GetTileRef(tilePos).Tile));
tileData.Add((tilePos, _maps.GetTileRef(oldGridUid, oldGrid, tilePos).Tile));
}
}

Expand Down Expand Up @@ -355,7 +355,7 @@ private void CheckSplits(EntityUid uid, HashSet<ChunkSplitNode> dirtyNodes)
}

// Set tiles on old grid
oldGrid.SetTiles(tileData);
_maps.SetTiles(oldGridUid, oldGrid, tileData);
GenerateSplitNodes(newGridUid, newGrid);
SendNodeDebug(newGridUid);
}
Expand Down Expand Up @@ -388,7 +388,7 @@ private void CheckSplits(EntityUid uid, HashSet<ChunkSplitNode> dirtyNodes)

private void GenerateSplitNodes(EntityUid gridUid, MapGridComponent grid)
{
foreach (var chunk in grid.GetMapChunks().Values)
foreach (var chunk in _maps.GetMapChunks(gridUid, grid).Values)
{
var group = CreateNodes(gridUid, grid, chunk);
_nodes[gridUid].Add(chunk.Indices, group);
Expand Down Expand Up @@ -479,7 +479,7 @@ private ChunkNodeGroup CreateNodes(EntityUid gridEuid, MapGridComponent grid, Ma
if (index.X == 0)
{
// Check West
if (grid.TryGetChunk(new Vector2i(chunk.Indices.X - 1, chunk.Indices.Y), out neighborChunk) &&
if (_maps.TryGetChunk(gridEuid, grid, new Vector2i(chunk.Indices.X - 1, chunk.Indices.Y), out neighborChunk) &&
TryGetNode(gridEuid, neighborChunk, new Vector2i(chunk.ChunkSize - 1, index.Y), out neighborNode))
{
chunkNode.Neighbors.Add(neighborNode);
Expand All @@ -490,7 +490,7 @@ private ChunkNodeGroup CreateNodes(EntityUid gridEuid, MapGridComponent grid, Ma
if (index.Y == 0)
{
// Check South
if (grid.TryGetChunk(new Vector2i(chunk.Indices.X, chunk.Indices.Y - 1), out neighborChunk) &&
if (_maps.TryGetChunk(gridEuid, grid, new Vector2i(chunk.Indices.X, chunk.Indices.Y - 1), out neighborChunk) &&
TryGetNode(gridEuid, neighborChunk, new Vector2i(index.X, chunk.ChunkSize - 1), out neighborNode))
{
chunkNode.Neighbors.Add(neighborNode);
Expand All @@ -501,7 +501,7 @@ private ChunkNodeGroup CreateNodes(EntityUid gridEuid, MapGridComponent grid, Ma
if (index.X == chunk.ChunkSize - 1)
{
// Check East
if (grid.TryGetChunk(new Vector2i(chunk.Indices.X + 1, chunk.Indices.Y), out neighborChunk) &&
if (_maps.TryGetChunk(gridEuid, grid, new Vector2i(chunk.Indices.X + 1, chunk.Indices.Y), out neighborChunk) &&
TryGetNode(gridEuid, neighborChunk, new Vector2i(0, index.Y), out neighborNode))
{
chunkNode.Neighbors.Add(neighborNode);
Expand All @@ -512,7 +512,7 @@ private ChunkNodeGroup CreateNodes(EntityUid gridEuid, MapGridComponent grid, Ma
if (index.Y == chunk.ChunkSize - 1)
{
// Check North
if (grid.TryGetChunk(new Vector2i(chunk.Indices.X, chunk.Indices.Y + 1), out neighborChunk) &&
if (_maps.TryGetChunk(gridEuid, grid, new Vector2i(chunk.Indices.X, chunk.Indices.Y + 1), out neighborChunk) &&
TryGetNode(gridEuid, neighborChunk, new Vector2i(index.X, 0), out neighborNode))
{
chunkNode.Neighbors.Add(neighborNode);
Expand Down
Loading