Fix cutter
This commit is contained in:
parent
1a6c91f4e9
commit
93f9d7ae23
|
@ -226,6 +226,10 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||||
|
|
||||||
const definition = /** @type {ShapeItem} */ (item).definition;
|
const definition = /** @type {ShapeItem} */ (item).definition;
|
||||||
const lowerLayer = /** @type {import("../shape_definition").ShapeLayer} */ (definition.layers[0]);
|
const lowerLayer = /** @type {import("../shape_definition").ShapeLayer} */ (definition.layers[0]);
|
||||||
|
if (!lowerLayer) {
|
||||||
|
return [null, null];
|
||||||
|
}
|
||||||
|
|
||||||
const topRightContent = lowerLayer[0];
|
const topRightContent = lowerLayer[0];
|
||||||
|
|
||||||
if (!topRightContent || topRightContent.subShape === null) {
|
if (!topRightContent || topRightContent.subShape === null) {
|
||||||
|
@ -263,8 +267,12 @@ export class LogicGateSystem extends GameSystemWithFilter {
|
||||||
const definition = /** @type {ShapeItem} */ (item).definition;
|
const definition = /** @type {ShapeItem} */ (item).definition;
|
||||||
const result = this.root.shapeDefinitionMgr.shapeActionCutHalf(definition);
|
const result = this.root.shapeDefinitionMgr.shapeActionCutHalf(definition);
|
||||||
return [
|
return [
|
||||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[0]),
|
result[0].isEntirelyEmpty()
|
||||||
this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[1]),
|
? null
|
||||||
|
: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[0]),
|
||||||
|
result[1].isEntirelyEmpty()
|
||||||
|
? null
|
||||||
|
: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(result[1]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue