diff --git a/js/cells/GIKCell.js b/js/cells/GIKCell.js index ff023e9c080b064615e6ce93ea15b76ee1bf5f82..f9563e7c02f9477fc945291a862f65613103b6a5 100644 --- a/js/cells/GIKCell.js +++ b/js/cells/GIKCell.js @@ -26,28 +26,32 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'], if (lattice.get("partType") == "willLego") { require(['gikPart'], function(PartSubclass){ + if (!self.index) return; parts.push(new PartSubclass(self.index.x, self)); callback(parts); }); } else if (lattice.get("partType") == "willLegoLowPoly") { require(['gikPartLowPoly'], function(PartSubclass){ + if (!self.index) return; parts.push(new PartSubclass(self.index.x, self)); callback(parts); }); } else if (lattice.get("partType") == "lego") { require(['legoPart'], function(PartSubclass){ + if (!self.index) return; parts.push(new PartSubclass(self.index.x, self)); callback(parts); }); } else if (lattice.get("partType") == "dnaLego") { require(['dnaLegoPart'], function(PartSubclass){ + if (!self.index) return; parts.push(new PartSubclass(self.index.x, self)); callback(parts); }); } else if (lattice.get("partType") == "dnaStraight") { require(['dnaStraightPart'], function(PartSubclass){ + if (!self.index) return; var parent = lattice.getUItarget(); - parent._parseSparseCell();//todo this should get checked var index = self.getLatticeIndex(); if (parent.cells[index.x][index.y][index.z+1]) var topNeighbor = parent.cells[index.x][index.y][index.z+1]; if (parent.cells[index.x][index.y][index.z-1]) var bottomNeighbor = parent.cells[index.x][index.y][index.z-1];