Merge pull request #120 from compiling/DoorDevUnstable
Extra warnings / checks
This commit is contained in:
14
Main.py
14
Main.py
@@ -30,12 +30,22 @@ from Utils import output_path, parse_player_names
|
||||
|
||||
__version__ = '0.5.0.0-u'
|
||||
|
||||
from source.classes.BabelFish import BabelFish
|
||||
|
||||
|
||||
class EnemizerError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def check_python_version():
|
||||
import sys
|
||||
version = sys.version_info
|
||||
if version.major < 3 or version.minor < 7:
|
||||
logging.warning(BabelFish().translate("cli","cli","old.python.version"), sys.version)
|
||||
|
||||
|
||||
def main(args, seed=None, fish=None):
|
||||
check_python_version()
|
||||
if args.outputpath:
|
||||
os.makedirs(args.outputpath, exist_ok=True)
|
||||
output_path.cached_path = args.outputpath
|
||||
@@ -258,11 +268,11 @@ def main(args, seed=None, fish=None):
|
||||
rom = JsonRom() if args.jsonout or use_enemizer else LocalRom(args.rom)
|
||||
|
||||
if use_enemizer and (args.enemizercli or not args.jsonout):
|
||||
base_patch = LocalRom(args.rom) # update base2current.json (side effect)
|
||||
local_rom = LocalRom(args.rom) # update base2current.json (side effect)
|
||||
if args.rom and not(os.path.isfile(args.rom)):
|
||||
raise RuntimeError("Could not find valid base rom for enemizing at expected path %s." % args.rom)
|
||||
if os.path.exists(args.enemizercli):
|
||||
patch_enemizer(world, player, rom, args.rom, args.enemizercli, sprite_random_on_hit)
|
||||
patch_enemizer(world, player, rom, local_rom, args.enemizercli, sprite_random_on_hit)
|
||||
enemized = True
|
||||
if not args.jsonout:
|
||||
rom = LocalRom.fromJsonRom(rom, args.rom, 0x400000)
|
||||
|
||||
Reference in New Issue
Block a user