diff --git a/rogueviz-kohonen.cpp b/rogueviz-kohonen.cpp index d22b60df..faa1deaa 100644 --- a/rogueviz-kohonen.cpp +++ b/rogueviz-kohonen.cpp @@ -645,9 +645,20 @@ void sominit(int initto, bool load_compressed) { allcells = cl.lst; } else allcells = currentmap->allcells(); - + if(isize(allcells) > kohrestrict) { - sort(allcells.begin(), allcells.end(), [] (cell *c1, cell *c2) { return hdist0(tC0(ggmatrix(c1))) < hdist0(tC0(ggmatrix(c2))); }); + map clindex; + for(int i=0; i 0 && hdist0(tC0(ggmatrix(allcells[at1-1]))) > dist - 1e-6) at1--; + printf("Cells numbered [%d,%d) are in the same distance\n", at1, at); allcells.resize(kohrestrict); }