aboutsummaryrefslogtreecommitdiff
path: root/server.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'server.mjs')
-rw-r--r--server.mjs8
1 files changed, 7 insertions, 1 deletions
diff --git a/server.mjs b/server.mjs
index b73c44e..f03eace 100644
--- a/server.mjs
+++ b/server.mjs
@@ -137,11 +137,17 @@ async function load() {
usedNext.add(nextId)
const wi = walk.indexOf(nextId)
const rot = wi > 0 ? walk.slice(wi).concat(walk.slice(0, wi)) : walk
+ const li = library.ids.indexOf(pid)
+ const ext = rot.slice()
+ for (let k = 1; ext.length < 60 && k < library.ids.length; k++) {
+ const wid = library.ids[(li + k) % library.ids.length]
+ if (wid !== pid && !ext.includes(wid)) ext.push(wid)
+ }
list.push({
dir: DIRS[i],
path: { type: p.type, name: p.name, count: p.count },
nextId,
- walk: rot,
+ walk: ext,
})
}
exits.set(pid, list)