Skip to content

Commit

Permalink
Fix Logs folder creation when User folder is nonlocal
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Apr 29, 2024
1 parent a4423f4 commit a4eeb92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Dolphin scripts/Entrance Randomizer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ async def main_loop():
draw_text(f"Current area: {hex(state.current_area_new).upper()} {f'({current_area.name})' if current_area else ''}")

# Always re-enable Item Swap.
if memory.read_u32(ADDRESSES.item_swap) == 1:
memory.write_u32(ADDRESSES.item_swap, 0)
memory.write_u32(ADDRESSES.item_swap, 0)

# Skip the intro fight and cutscene
if highjack_transition(0x0, JAGUAR, starting_area):
Expand Down
5 changes: 3 additions & 2 deletions Dolphin scripts/Entrance Randomizer/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def dump_spoiler_logs(starting_area_name: str, transitions_map: dict[int, dict[i
f"To: {TRANSITION_INFOS_DICT[to_old].name}. " + \
f"Redirecting to: {TRANSITION_INFOS_DICT[to_new].name}\n"

# TODO: Get actual user folder based whether Dolphin Emulator is in AppData/Roaming
# and if the current installation is portable.
dolphin_path = Path().absolute()
print("path in utils", dolphin_path)
spoiler_logs_file = dolphin_path / "User" / "Logs" / f"SPOILER_LOGS_v{__version__}_{seed_string}.txt"
Path.mkdir(spoiler_logs_file.parent, exist_ok=True)
Path.mkdir(spoiler_logs_file.parent, parents=True, exist_ok=True)
Path.write_text(spoiler_logs_file, spoiler_logs)
print("Spoiler logs written to", spoiler_logs_file)

0 comments on commit a4eeb92

Please sign in to comment.