Skip to content

Commit

Permalink
weh
Browse files Browse the repository at this point in the history
  • Loading branch information
EmoGarbage404 committed Apr 17, 2024
1 parent 5bec60b commit e16cfc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Lidgren.Network/Lidgren.Network
Original file line number Diff line number Diff line change
Expand Up @@ -1534,12 +1534,12 @@ public bool SwapPositions(Entity<TransformComponent?> entity1, Entity<TransformC
MapCoordinates? pos2 = null;

if (_container.TryGetContainingContainer(entity1, out var container1))
_container.TryRemoveFromContainer(entity1, true);
_container.Remove(entity1, container1, force: true);
else
pos1 = GetMapCoordinates(entity1.Comp);

if (_container.TryGetContainingContainer(entity2, out var container2))
_container.TryRemoveFromContainer(entity2, true);
_container.Remove(entity2, container2, force: true);
else
pos2 = GetMapCoordinates(entity2.Comp);

Expand All @@ -1559,7 +1559,7 @@ public bool SwapPositions(Entity<TransformComponent?> entity1, Entity<TransformC

if (!_gridQuery.HasComponent(entity1) && _mapManager.TryFindGridAt(mapUid, pos2.Value.Position, out var targetGrid, out _))
{
var (_, _, invWorldMatrix) = GetWorldPositionRotationInvMatrix(targetGrid);
var invWorldMatrix = GetInvWorldMatrix(targetGrid);
SetCoordinates(entity1, new EntityCoordinates(targetGrid, invWorldMatrix.Transform(pos2.Value.Position)));
}
else
Expand All @@ -1582,7 +1582,7 @@ public bool SwapPositions(Entity<TransformComponent?> entity1, Entity<TransformC

if (!_gridQuery.HasComponent(entity1) && _mapManager.TryFindGridAt(mapUid, pos1.Value.Position, out var targetGrid, out _))
{
var (_, _, invWorldMatrix) = GetWorldPositionRotationInvMatrix(targetGrid);
var invWorldMatrix = GetInvWorldMatrix(targetGrid);
SetCoordinates(entity2, new EntityCoordinates(targetGrid, invWorldMatrix.Transform(pos1.Value.Position)));
}
else
Expand Down

0 comments on commit e16cfc9

Please sign in to comment.