diff --git a/src/js/game/shape_definition.js b/src/js/game/shape_definition.js index 3a777f6f..a9e9e7ba 100644 --- a/src/js/game/shape_definition.js +++ b/src/js/game/shape_definition.js @@ -570,10 +570,12 @@ export class ShapeDefinition extends BasicSerializableObject { const bottomShapeLayer = mergedLayers[layerMergingAt]; const topShapeLayer = topShapeLayers[layer]; for (let quad = 0; quad < 4; quad++) { + assert(!(bottomShapeLayer[quad] && topShapeLayer[quad]), "Shape merge: Sub shape got lost"); bottomShapeLayer[quad] = bottomShapeLayer[quad] || topShapeLayer[quad]; } } + // Limit to 4 layers at max mergedLayers.splice(4); return new ShapeDefinition({ layers: mergedLayers });