From 30303a3ad0d0f31d93c25f42bfd10d70e8277b72 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 10 Dec 2022 22:27:08 +0100 Subject: Update --- includes/travelling.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes/travelling.inc') diff --git a/includes/travelling.inc b/includes/travelling.inc index b0b58f0..18bf22e 100644 --- a/includes/travelling.inc +++ b/includes/travelling.inc @@ -25,6 +25,10 @@ foreach ($members as $member) { @file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); } + + if (!isset($travelling[$member["id"]]["equestria"])) { + $travelling[$member["id"]]["equestria"] = false; + } } function withTravelers(array $members, string $system): array { @@ -35,13 +39,13 @@ function withTravelers(array $members, string $system): array { $i['system'] = $system; return $i; }, array_filter($members, function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); })), ...array_filter(array_map(function ($i) use ($system) { $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; return $i; }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); }) ]; } \ No newline at end of file -- cgit