mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Add checks to stacking logic
This commit is contained in:
parent
58a4543c29
commit
2d54b72882
@ -570,10 +570,12 @@ export class ShapeDefinition extends BasicSerializableObject {
|
|||||||
const bottomShapeLayer = mergedLayers[layerMergingAt];
|
const bottomShapeLayer = mergedLayers[layerMergingAt];
|
||||||
const topShapeLayer = topShapeLayers[layer];
|
const topShapeLayer = topShapeLayers[layer];
|
||||||
for (let quad = 0; quad < 4; quad++) {
|
for (let quad = 0; quad < 4; quad++) {
|
||||||
|
assert(!(bottomShapeLayer[quad] && topShapeLayer[quad]), "Shape merge: Sub shape got lost");
|
||||||
bottomShapeLayer[quad] = bottomShapeLayer[quad] || topShapeLayer[quad];
|
bottomShapeLayer[quad] = bottomShapeLayer[quad] || topShapeLayer[quad];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Limit to 4 layers at max
|
||||||
mergedLayers.splice(4);
|
mergedLayers.splice(4);
|
||||||
|
|
||||||
return new ShapeDefinition({ layers: mergedLayers });
|
return new ShapeDefinition({ layers: mergedLayers });
|
||||||
|
Loading…
Reference in New Issue
Block a user