From ce6cdcaf921a146c43842c803e5f52be593c28a5 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Sun, 15 Aug 2021 06:13:58 -0500 Subject: [PATCH] Minecraft client: prevent options.yaml/host.yaml contamination from non-install directories --- MinecraftClient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MinecraftClient.py b/MinecraftClient.py index 512aa5ad..b55be8bb 100644 --- a/MinecraftClient.py +++ b/MinecraftClient.py @@ -157,14 +157,14 @@ if __name__ == '__main__': parser.add_argument("apmc_file", default=None, nargs='?', help="Path to an Archipelago Minecraft data file (.apmc)") args = parser.parse_args() - options = Utils.get_options() - apmc_file = os.path.abspath(args.apmc_file) if args.apmc_file is not None else None - forge_dir = options["minecraft_options"]["forge_directory"] - max_heap = options["minecraft_options"]["max_heap_size"] # Change to executable's working directory os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]))) + + options = Utils.get_options() + forge_dir = options["minecraft_options"]["forge_directory"] + max_heap = options["minecraft_options"]["max_heap_size"] if apmc_file is not None and not os.path.isfile(apmc_file): raise FileNotFoundError(f"Path {apmc_file} does not exist or could not be accessed.")