Fix connected blocks not being detected in prefabs
Apparently they're processed, unlike in my save
This commit is contained in:
parent
dba7c0a46f
commit
5660bfc28d
1 changed files with 11 additions and 5 deletions
|
@ -39,11 +39,17 @@ namespace GamecraftModdingAPI.Blocks
|
||||||
{
|
{
|
||||||
if (!BlockExists(blockID)) return new Block[0];
|
if (!BlockExists(blockID)) return new Block[0];
|
||||||
Stack<uint> cubeStack = new Stack<uint>();
|
Stack<uint> cubeStack = new Stack<uint>();
|
||||||
FasterList<uint> cubesToProcess = new FasterList<uint>();
|
FasterList<uint> cubes = new FasterList<uint>(10);
|
||||||
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; });
|
var coll = entitiesDB.QueryEntities<GridConnectionsEntityStruct>(CommonExclusiveGroups
|
||||||
var ret = new Block[cubesToProcess.count];
|
.OWNED_BLOCKS_GROUP);
|
||||||
for (int i = 0; i < cubesToProcess.count; i++)
|
for (int i = 0; i < coll.count; i++)
|
||||||
ret[i] = new Block(cubesToProcess[i]);
|
coll[i].isProcessed = false;
|
||||||
|
|
||||||
|
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; });
|
||||||
|
|
||||||
|
var ret = new Block[cubes.count];
|
||||||
|
for (int i = 0; i < cubes.count; i++)
|
||||||
|
ret[i] = new Block(cubes[i]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue