SoE: produce useful error if ROM does not exist

This commit is contained in:
black-sliver 2021-11-14 15:46:07 +01:00 committed by Fabian Dill
parent d623cd5ce0
commit 55bfc71269
1 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@ from Utils import get_options, output_path
import typing
import lzma
import os
import os.path
import threading
try:
@ -200,8 +201,10 @@ class SoEWorld(World):
line = f'{loc.type},{loc.index}:{item.type},{item.index}\n'
f.write(line.encode('utf-8'))
if (pyevermizer.main(rom_file, out_file, placement_file, self.world.seed_name, self.connect_name, self.evermizer_seed,
flags, money, exp)):
if not os.path.exists(rom_file):
raise FileNotFoundError(rom_file)
if (pyevermizer.main(rom_file, out_file, placement_file, self.world.seed_name, self.connect_name,
self.evermizer_seed, flags, money, exp)):
raise RuntimeError()
with lzma.LZMAFile(patch_file, 'wb') as f:
f.write(generate_patch(rom_file, out_file,