Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Sandbox.Game.MyInventory IsConnected is not thread safe #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions Sources/Sandbox.Game/ModAPI/MyInventory_ModAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ private bool TransferItemsTo(IMyInventory dst, int sourceItemIndex, int? targetI
return false;
}

List<IMyConveyorEndpoint> reachableVertices = new List<IMyConveyorEndpoint>();

private bool IsConnected(MyInventory dstInventory)
{
var srcConveyor = (this.Owner as IMyConveyorEndpointBlock);
if (srcConveyor != null)
{
reachableVertices.Clear();
var reachableVertices = new List<IMyConveyorEndpoint>();
MyGridConveyorSystem.FindReachable(srcConveyor.ConveyorEndpoint, reachableVertices, (vertex) => vertex.CubeBlock != null);
foreach (var vertex in reachableVertices)
{
Expand Down