npc path error

This commit is contained in:
Kolby Nottingham 2024-11-05 16:26:23 -08:00
parent 25f69a9c1c
commit ce983df59c

View file

@ -39,14 +39,14 @@ export class NPCContoller {
} }
init() { init() {
for (let file of readdirSync('src/agent/npc/construction')) { try {
if (file.endsWith('.json')) { for (let file of readdirSync('src/agent/npc/construction')) {
try { if (file.endsWith('.json')) {
this.constructions[file.slice(0, -5)] = JSON.parse(readFileSync('src/agent/npc/construction/' + file, 'utf8')); 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) { for (let name in this.constructions) {