From 1aa76fcb0af0e02fe4babeaba1ed9341947d6f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gastinel?= Date: Sat, 31 Oct 2026 12:24:32 +0100 Subject: [PATCH] atlas_calage: lit les parametres via le chargeur public de proc-relief Un fichier absent reste une erreur pour le calage (pas de repli silencieux). Co-Authored-By: Claude Sonnet 5.5 --- proc-relief/examples/atlas_calage.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proc-relief/examples/atlas_calage.rs b/proc-relief/examples/atlas_calage.rs index d03b364..60e903b 100644 --- a/proc-relief/examples/atlas_calage.rs +++ b/proc-relief/examples/atlas_calage.rs @@ -296,7 +296,10 @@ fn charger_ref(atlas: &str, dir: &str, idb: &str) -> Ref { construire_ref_multi(sites) } fn charger_params(dp: &str, id: &str) -> ParamsRelief { - serde_json::from_str(&std::fs::read_to_string(format!("{dp}/{id}.json")).unwrap()).unwrap() + // chargeur public de la crate ; un fichier absent est une erreur ici (le calage ne doit pas se rabattre en silence sur table_initiale) + let b = BIOMES.iter().find(|e| e.1 == id).expect("biome inconnu").2; + assert!(std::path::Path::new(&format!("{dp}/{id}.json")).exists(), "paramètres absents : {dp}/{id}.json"); + charger_params_biome(std::path::Path::new(dp), b).unwrap_or_else(|e| panic!("{e}")) } fn generateur(seed: u64, b: BiomeRelief, p: &ParamsRelief) -> Generateur { let mut t = table_initiale();