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() {
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) {