X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fquadtree.cpp;fp=src%2Fquadtree.cpp;h=b84bb78b3071de6fe9bb10a6853def420f7aef48;hp=3d5dbeedb954a0d656d225e5b4124ca7d043bbae;hb=efdd8f483157ceeb1bae535840934ac770126a28;hpb=67539822c80c8057d850b542abc142c189bd3f05 diff --git a/src/quadtree.cpp b/src/quadtree.cpp index 3d5dbee..b84bb78 100644 --- a/src/quadtree.cpp +++ b/src/quadtree.cpp @@ -70,6 +70,12 @@ QuadTreeIndex QuadTree::GetNeighbour(QuadTreeIndex start, int xdir, int ydir, Do { if (!xdir && !ydir) return start; + if (addTo && (nodes[start].parent == -1) && nodes[start].child_type != QTC_UNKNOWN) + { + Debug("Adding parent of node %d...", start); + addTo->GenQuadParent(start, nodes[start].child_type); + } + QuadTreeIndex newNode; // Try moving to the right if that's easy. if (xdir > 0)