This commit is contained in:
Azgaar 2019-08-31 12:16:36 +03:00
parent 5f9cab4f84
commit cab429a346
58 changed files with 6413 additions and 1489 deletions

View file

@ -148,6 +148,7 @@
const regenerate = function() {
routes.selectAll("path").remove();
pack.cells.road = new Uint16Array(pack.cells.i.length);
pack.cells.crossroad = new Uint16Array(pack.cells.i.length);
const main = getRoads();
const small = getTrails();
const ocean = getSearoutes();
@ -203,8 +204,8 @@
if (segment.length) {
segment.push(current);
path.push(segment);
if (segment[0] !== end) cells.road[segment[0]] += score; // crossroad
if (current !== start) cells.road[current] += score; // crossroad
if (segment[0] !== end) {cells.road[segment[0]] += score; cells.crossroad[segment[0]] += score;}
if (current !== start) {cells.road[current] += score; cells.crossroad[current] += score;}
}
segment = [];
prev = current;