From 69ca24889add78fab7071ca82c148d8c4e804846 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 3 Dec 2018 18:40:37 +0100 Subject: [PATCH] fix half-dimension so that it is positive --- crystal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crystal.cpp b/crystal.cpp index d4c1e737..ec4df171 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -217,8 +217,8 @@ struct crystal_structure { void remove_half_dimension() { dir--; for(int i=0; i<(1<= (1<<(dim-1))) take_what = dir-1; + int take_what = dir-1; + if(i >= (1<<(dim-1))) take_what = dir; next[i][prev[i][take_what]] = next[i][take_what], prev[i][next[i][take_what]] = prev[i][take_what], next[i].resize(dir), @@ -560,7 +560,7 @@ int dist_relative(cell *c) { m->camelot_coord = m->get_coord(m->camelot_center); if(m->cs.dir % 2) - m->camelot_coord[m->cs.dim-1] = 2; + m->camelot_coord[m->cs.dim-1] = 1; m->camelot_mul = 1; m->camelot_mul *= (r+5) / space_distance_camelot(start);