diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index 1d73fc52b202eaaf535c9f2872b15b5560af7d18..8fa62bd7c2102c0b6b4224a2078ccb00560326a5 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -21,7 +21,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' if (this.superCell) this.superCell.addChildren(this.object3D);//add as child of supercell - if (this.index){//todo gik supcells in stock have index but no highlight + if (this.getAbsoluteIndex()){ if (!this.cells) lattice.getUItarget().addHighlightableCell(this.object3D.children[0]);//add mesh as highlightable object, only for lowest level of hierarchy if (!superCell || superCell === undefined) three.sceneAdd(this.object3D);//add object3d as child of scene if top level of hierarchy } else this.hide();//stock cell @@ -102,7 +102,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' return null; } if (!this.superCell) return this.getIndex(); - return this.superCell.getAbsoluteIndex().add(this.superCell.applyRotation(this.getIndex()).round()); + var superCellIndex = this.superCell.getAbsoluteIndex(); + if (!superCellIndex) return null; + return superCellIndex.add(this.superCell.applyRotation(this.getIndex()).round()); }; DMACell.prototype.getPosition = function(){