Skip to content

Commit

Permalink
Removes duplicate position set when splitting grids
Browse files Browse the repository at this point in the history
There's nothing saying why this is this way and the blame looks like it was an oversight when replacing a bit where they set position and then rotation
Please, oh Chesterton's Fence, spare me your wrath
  • Loading branch information
TemporalOroboros committed Feb 6, 2025
1 parent 43a80ea commit 2377cb5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Robust.Server/Physics/GridFixtureSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ private void CheckSplits(EntityUid uid, HashSet<ChunkSplitNode> dirtyNodes)
newGrids[i] = newGridUid;

// Keep same origin / velocity etc; this makes updating a lot faster and easier.
_xformSystem.SetWorldPosition((newGridUid, newGridXform), gridPos);
_xformSystem.SetWorldPositionRotation(newGridUid, gridPos, gridRot, newGridXform); // Why do we set this twice???
_xformSystem.SetWorldPositionRotation(newGridUid, gridPos, gridRot, newGridXform);
var splitBody = _bodyQuery.GetComponent(newGridUid);
_physics.SetLinearVelocity(newGridUid, mapBody.LinearVelocity, body: splitBody);
_physics.SetAngularVelocity(newGridUid, mapBody.AngularVelocity, body: splitBody);
Expand Down

0 comments on commit 2377cb5

Please sign in to comment.