From ee830586b71353ab253fe4a9431ebb09873485da Mon Sep 17 00:00:00 2001 From: AyeZeeBB Date: Sun, 25 Oct 2026 14:50:36 -0500 Subject: [PATCH] Board materials: one mod's broken reskate-materials.json leaves only that mod out, not every mod's declared colours Since the declarations were read from the applied catalogue, a file that could not be read or parsed threw out of the whole refresh, so no mod's declared inputs applied (from launch, or after a live apply). Each file is read on its own again: a broken one is logged with its mod and skipped, and only a failed read of item ownership keeps the previous set. --- Extension/Customization/board_material.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Extension/Customization/board_material.cpp b/Extension/Customization/board_material.cpp index 2261b480..72ed1e4d 100644 --- a/Extension/Customization/board_material.cpp +++ b/Extension/Customization/board_material.cpp @@ -138,11 +138,18 @@ DeclarationSet read_declarations(const std::vector& auto sources = mods::read_item_sources_checked(signature[1].path); if (!sources) throw std::runtime_error("Item ownership could not be read; retaining previous declarations"); result.sources = std::move(*sources); + // A mod whose file cannot be read or parsed is left out on its own: the others' declarations stand. + // (Read only when a file changed, so this is said once for each change.) for (std::size_t at = 2; at < signature.size(); ++at) { const auto& file = signature[at]; if (!file.present) continue; - auto read = mods::parse_material_declarations(file.owner, read_shared_text(file.path, 64 * 1024)); - std::move(read.begin(), read.end(), std::back_inserter(result.materials)); + try { + auto read = mods::parse_material_declarations(file.owner, read_shared_text(file.path, 64 * 1024)); + std::move(read.begin(), read.end(), std::back_inserter(result.materials)); + } catch (const std::exception& failure) { + logging::log(logging::Level::warning, logging::Channel::customization, + "Board parameters: {}'s reskate-materials.json is left out: {}", file.owner, failure.what()); + } } return result; }