forked from Mirrorlandia_minetest/minetest
+ check if sectors/sectors2 directories exist before attempting to read them
This commit is contained in:
parent
34e57da1ca
commit
bd5cdbf1a4
@ -73,25 +73,28 @@ xlist = []
|
|||||||
zlist = []
|
zlist = []
|
||||||
|
|
||||||
# List all sectors to memory and calculate the width and heigth of the resulting picture.
|
# List all sectors to memory and calculate the width and heigth of the resulting picture.
|
||||||
for filename in os.listdir(path + "sectors2"):
|
if os.path.exists(path + "sectors2"):
|
||||||
for filename2 in os.listdir(path + "sectors2/" + filename):
|
for filename in os.listdir(path + "sectors2"):
|
||||||
x = hex_to_int(filename)
|
for filename2 in os.listdir(path + "sectors2/" + filename):
|
||||||
z = hex_to_int(filename2)
|
x = hex_to_int(filename)
|
||||||
|
z = hex_to_int(filename2)
|
||||||
|
if x < sector_xmin or x > sector_xmax:
|
||||||
|
continue
|
||||||
|
if z < sector_zmin or z > sector_zmax:
|
||||||
|
continue
|
||||||
|
xlist.append(x)
|
||||||
|
zlist.append(z)
|
||||||
|
|
||||||
|
if os.path.exists(path + "sectors"):
|
||||||
|
for filename in os.listdir(path + "sectors"):
|
||||||
|
x = hex4_to_int(filename[:4])
|
||||||
|
z = hex4_to_int(filename[-4:])
|
||||||
if x < sector_xmin or x > sector_xmax:
|
if x < sector_xmin or x > sector_xmax:
|
||||||
continue
|
continue
|
||||||
if z < sector_zmin or z > sector_zmax:
|
if z < sector_zmin or z > sector_zmax:
|
||||||
continue
|
continue
|
||||||
xlist.append(x)
|
xlist.append(x)
|
||||||
zlist.append(z)
|
zlist.append(z)
|
||||||
for filename in os.listdir(path + "sectors"):
|
|
||||||
x = hex4_to_int(filename[:4])
|
|
||||||
z = hex4_to_int(filename[-4:])
|
|
||||||
if x < sector_xmin or x > sector_xmax:
|
|
||||||
continue
|
|
||||||
if z < sector_zmin or z > sector_zmax:
|
|
||||||
continue
|
|
||||||
xlist.append(x)
|
|
||||||
zlist.append(z)
|
|
||||||
|
|
||||||
w = (max(xlist) - min(xlist)) * 16 + 16
|
w = (max(xlist) - min(xlist)) * 16 + 16
|
||||||
h = (max(zlist) - min(zlist)) * 16 + 16
|
h = (max(zlist) - min(zlist)) * 16 + 16
|
||||||
|
Loading…
Reference in New Issue
Block a user