1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

Emit better warnings when loading LGB files

Now the "Loading XYZ.lgb" message only shows up *if* we find the file,
and if it fails to parse then we tell people to report it to us.

See #35
This commit is contained in:
Joshua Goins 2025-06-21 09:27:12 -04:00
parent 347a12a1b5
commit 9405714e56

View file

@ -39,9 +39,13 @@ impl Zone {
let mut load_lgb = |name: &str| -> Option<LayerGroup> {
let path = format!("bg/{}/level/{}.lgb", &bg_path[..level_index], name);
let lgb_file = game_data.extract(&path)?;
tracing::info!("Loading {path}");
let lgb = game_data.extract(&path)?;
LayerGroup::from_existing(&lgb)
let lgb = LayerGroup::from_existing(&lgb_file);
if lgb.is_none() {
tracing::warn!("Failed to parse {path}, this is most likely a bug in Physis and should be reported somewhere!")
}
lgb
};
zone.planevent = load_lgb("planevent");