From ce983df59c3d461f81ee52da78d53bed62db7b84 Mon Sep 17 00:00:00 2001 From: Kolby Nottingham Date: Tue, 5 Nov 2024 16:26:23 -0800 Subject: [PATCH] npc path error --- src/agent/npc/controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/agent/npc/controller.js b/src/agent/npc/controller.js index 227328e..8464efe 100644 --- a/src/agent/npc/controller.js +++ b/src/agent/npc/controller.js @@ -39,14 +39,14 @@ export class NPCContoller { } init() { - for (let file of readdirSync('src/agent/npc/construction')) { - if (file.endsWith('.json')) { - try { + try { + for (let file of readdirSync('src/agent/npc/construction')) { + if (file.endsWith('.json')) { this.constructions[file.slice(0, -5)] = JSON.parse(readFileSync('src/agent/npc/construction/' + file, 'utf8')); - } catch (e) { - console.log('Error reading construction file: ', file); } } + } catch (e) { + console.log('Error reading construction file: ', file); } for (let name in this.constructions) {