From dd5035184bedab560a36b97e1c74c7feb79c15a0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 12 Jul 2021 20:54:45 +0200 Subject: [PATCH] improved adj_minefield_cells to avoid relative_matrix --- cell.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cell.cpp b/cell.cpp index d9fa06b6..1c2cd0e1 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1293,20 +1293,25 @@ EX vector adj_minefield_cells(cell *c) { const vector& vertices = ss.vertices_only_local; manual_celllister cl; cl.add(c); + vector M = {Id}; for(int i=0; irelative_matrix(c1->master, c->master, C0); auto& ss1 = currentmap->get_cellshape(c1); auto& vertices1 = ss1.vertices_only_local; for(hyperpoint h: vertices) for(hyperpoint h2: vertices1) if(hdist(h, T * h2) < 1e-6) shares = true; if(shares) res.push_back(c1); } - if(shares || c == c1) forCellEx(c2, c1) cl.add(c2); + if(shares || c == c1) forCellIdEx(c2, i, c1) { + if(cl.listed(c2)) continue; + cl.add(c2); + M.push_back(T * currentmap->adj(c1, i)); + } } - println(hlog, "adjacent to ", c, " = ", isize(res)); + // println(hlog, "adjacent to ", c, " = ", isize(res), " of ", isize(M)); adj_memo[c] = res; } return res;