diff --git a/lib/controllers/LocationController.js b/lib/controllers/LocationController.js index 74a7942c..166c49bc 100644 --- a/lib/controllers/LocationController.js +++ b/lib/controllers/LocationController.js @@ -76,7 +76,7 @@ class LocationController { * @returns {string} zlib compressed json string */ static async testData(request, reply) { - const staticMapName = "factory4_day"; + const staticMapName = "woods"; const location_data = await Location.generateLocationData(staticMapName); if (typeof location_data != "undefined") { console.log(`Name: ${location_data.Name}`) diff --git a/lib/models/Location.js b/lib/models/Location.js index ca5bcfd2..5f9641b7 100644 --- a/lib/models/Location.js +++ b/lib/models/Location.js @@ -262,7 +262,7 @@ class Location extends BaseModel { const containerTable = lootGenData.containersSpawnData[containerId]; if(containerTable == null){ await logger.error(`Container: ${containerId} not found in conrainersSpawnData.json`); - return; + return data; } const containerTemplate = await Item.get(containerId); let SpawnList = {} @@ -323,6 +323,7 @@ class Location extends BaseModel { // generate specific container loot here !!! data = await this.generateContainerContents(data); // push result to output + if(data == null) console.log(lootSpawn.worldId); output.Loot.push(data); } /** @@ -361,6 +362,7 @@ class Location extends BaseModel { } data.Items.push({ _id: newId, _tpl: quest.questItmTpl }); data.Root = newId; + output.Loot.push(data); };