From 3cb2d3ffecb06862613d8c6ff070cf5f2f1d2641 Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Mon, 7 Mar 2016 21:56:50 -0500 Subject: [PATCH] improving world path or input allow name only if in worlds_path --- chunkymap-regen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chunkymap-regen.py b/chunkymap-regen.py index 66153dd..7b8dcf4 100644 --- a/chunkymap-regen.py +++ b/chunkymap-regen.py @@ -507,9 +507,14 @@ class MTChunks: else: print("(and no world could be found in worlds_path '"+self.config["worlds_path"]+"')") - input_string = raw_input("World path--must type full path (blank for ["+self.config["world_path"]+"]): ") + input_string = raw_input("World path (or world name if above; blank for ["+self.config["world_path"]+"]): ") if (len(input_string)>0): - self.config["world_path"] = input_string + + try_path = os.path.join(self.config["worlds_path"], input_string) + this_world_path = input_string + if (not os.path.isdir(this_world_path)) and os.path.isdir(try_path): + this_world_path = try_path + self.config["world_path"] = this_world_path auto_chosen_world = False is_config_changed = True print ("Using world_path '"+self.config["world_path"]+"'")