SoE: produce useful error if ROM does not exist
This commit is contained in:
parent
d623cd5ce0
commit
55bfc71269
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue