diff --git a/includes/gear_guide.php b/includes/gear_guide.php index 931eeff..aed3c04 100644 --- a/includes/gear_guide.php +++ b/includes/gear_guide.php @@ -124,8 +124,15 @@ function gear_guide_normalize(array $raw): array function gear_guide_stat_options(): array { $groups = array_fill_keys(array_keys(GEAR_GUIDE_STAT_GROUPS), []); + // gear_items.slot ist der Slot aus dem Spiel ("Torso", "Necklace" …) - dritter Eintrag in GEAR_SLOTS + $slotGroups = []; + foreach (GEAR_SLOTS as $slotKey => [, $slotGroup, $gameSlots]) { + foreach (array_merge([$slotKey], $gameSlots) as $name) { + $slotGroups[$name] = GEAR_GUIDE_SLOT_GROUPS[$slotGroup] ?? null; + } + } foreach (db()->query('SELECT slot, data FROM gear_items')->fetchAll() as $row) { - $group = GEAR_GUIDE_SLOT_GROUPS[GEAR_SLOTS[$row['slot']][1] ?? ''] ?? null; + $group = $slotGroups[$row['slot']] ?? null; if ($group === null) { continue; }