From 7b1c251fcb085dc37de439ea1137373f1905d82e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 23 Aug 2023 20:29:07 +0200 Subject: areas and capture and more --- db/areas.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'db/areas.php') 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; -- cgit v1.2.3