From d930b6155b48badb8fac584305ffa2c873c43416 Mon Sep 17 00:00:00 2001 From: Caleb Smith Date: Wed, 1 Jun 2022 13:46:25 -0500 Subject: [PATCH] Fixes for dumb things --- bcml/install.py | 2 +- src/mergers/actorinfo.rs | 1 + src/mergers/pack.rs | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bcml/install.py b/bcml/install.py index 7d29f17f..17bc5d59 100644 --- a/bcml/install.py +++ b/bcml/install.py @@ -741,7 +741,7 @@ def disable_bcml_gfx(): def link_master_mod(output: Path = None): util.create_bcml_graphicpack_if_needed() - rsext.manager.link_master_mod(str(output.absolute())) + rsext.manager.link_master_mod(str(output.resolve()) if output else None) # if not output: # if not util.get_settings( # "export_dir" if util.get_settings("wiiu") else "export_dir_nx" diff --git a/src/mergers/actorinfo.rs b/src/mergers/actorinfo.rs index 05ab0286..6a33eafa 100644 --- a/src/mergers/actorinfo.rs +++ b/src/mergers/actorinfo.rs @@ -139,6 +139,7 @@ fn merge_actorinfo(py: Python, modded_actors: Vec) -> PyResult<()> { ); let output = util::settings() .master_mod_dir() + .join(util::content()) .join("Actor/ActorInfo.product.sbyml"); if !output.parent().unwrap().exists() { std::fs::create_dir_all(output.parent().unwrap())?; diff --git a/src/mergers/pack.rs b/src/mergers/pack.rs index 34e86c9c..ab05773a 100644 --- a/src/mergers/pack.rs +++ b/src/mergers/pack.rs @@ -1,6 +1,6 @@ use crate::{ util::{self, settings}, - Result, + Result, RustError, }; use anyhow::Context; use cow_utils::CowUtils; @@ -125,7 +125,12 @@ pub fn merge_sarcs(py: Python, diffs: HashMap>) -> PyResul } let sarcs = sarc_paths .iter() - .map(|file| -> Result { Ok(Sarc::read(std::fs::read(&file)?)?) }) + .filter_map(|file| -> Option> { + std::fs::read(&file) + .map(|data| Sarc::read(data).ok()) + .map_err(RustError::from) + .transpose() + }) .collect::>>()?; let mut merged = merge_sarc(sarcs, settings.endian())?; if out.extension().unwrap().to_str().unwrap().starts_with('s') {