0

get_worlds only considers world dirs of length 6

(I like to store backups of my worlds in the same dir as World1.tar and
it was trying to open up world number 'r')
This commit is contained in:
Andrew Brown
2010-09-21 22:36:06 -04:00
parent 07145bef3b
commit 7278286599

View File

@@ -146,7 +146,7 @@ def get_worlds():
ret = {}
save_dir = get_save_dir()
for dir in os.listdir(save_dir):
if dir.startswith("World"):
if dir.startswith("World") and len(dir) == 6:
world_n = int(dir[-1])
info = nbt.load(os.path.join(save_dir, dir, "level.dat"))[1]
info['Data']['path'] = os.path.join(save_dir, dir)