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];
|
||||
Stack<uint> cubeStack = new Stack<uint>();
|
||||
FasterList<uint> cubesToProcess = new FasterList<uint>();
|
||||
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; });
|
||||
var ret = new Block[cubesToProcess.count];
|
||||
for (int i = 0; i < cubesToProcess.count; i++)
|
||||
ret[i] = new Block(cubesToProcess[i]);
|
||||
FasterList<uint> cubes = new FasterList<uint>(10);
|
||||
var coll = entitiesDB.QueryEntities<GridConnectionsEntityStruct>(CommonExclusiveGroups
|
||||
.OWNED_BLOCKS_GROUP);
|
||||
for (int i = 0; i < coll.count; 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue