From 51488d8d802a95a8c541c7f2d606fbf3e994390e Mon Sep 17 00:00:00 2001 From: Caleb Smith Date: Sun, 15 Sep 2019 16:51:23 -0500 Subject: [PATCH] Another map merge fix --- bcml/mubin.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bcml/mubin.py b/bcml/mubin.py index d391d379..7485b24b 100644 --- a/bcml/mubin.py +++ b/bcml/mubin.py @@ -50,9 +50,16 @@ def get_stock_map(map_unit: Union[Map, tuple], force_vanilla: bool = False) -> d map_bytes = None if force_vanilla: try: - map_bytes = util.get_game_file( - f'Map/MainField/{map_unit.section}/{map_unit.section}_{map_unit.type}.smubin' - ).read_bytes() + map_path = ( + util.get_update_dir() / 'Map/MainField/' + f'{map_unit.section}/{map_unit.section}_{map_unit.type}.smubin' + ) + if not map_path.exists(): + map_path = ( + util.get_game_dir() / 'Map/MainField/' + f'{map_unit.section}/{map_unit.section}_{map_unit.type}.smubin' + ) + map_bytes = map_path.read_bytes() except FileNotFoundError: with util.get_game_file('Pack/TitleBG.pack').open('rb') \ as s_file: