summaryrefslogtreecommitdiff
path: root/db/areas.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-23 20:29:07 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-23 20:29:07 +0200
commit7b1c251fcb085dc37de439ea1137373f1905d82e (patch)
tree32e3f2cd4367507726af6d0172e9621a37dff576 /db/areas.php
parent4dd1a344c6474087a3f8782dd54f5c7b4acc67ed (diff)
areas and capture and more
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;