summaryrefslogtreecommitdiff
path: root/db/areas.php
diff options
context:
space:
mode:
Diffstat (limited to 'db/areas.php')
-rw-r--r--db/areas.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/db/areas.php b/db/areas.php
index 185589e..d423a3e 100644
--- a/db/areas.php
+++ b/db/areas.php
@@ -8,10 +8,15 @@ foreach (scandir(__DIR__ . '/areas') as $file) {
$area = json_decode(file_get_contents($filePath), true);
$encounters = json_decode(@file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/encounter/$area[encounter_slug].json") ?? '', true);
- $environment = json_decode(file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/environment/$area[environment_slug].json"), true);
+ $environment = json_decode(@file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/environment/$area[environment_slug].json") ?? '', true);
$map = @file_get_contents(__DIR__ . "/maps/$fileName.svg");
+ $area['encounters'] ??= [];
array_push($area['encounters'], ...$encounters['monsters'] ?? []);
+ $area['requiredEncounters'] ??= 0;
+
+ $area['trainers'] ??= [];
+
$area['environment'] = $environment;
$area['map'] = $map;