Browse Source

fixing bounds for geometry param

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
6839163352
  1. 2
      chunkymap-regen.py
  2. 8
      minetestmapper.py

2
chunkymap-regen.py

@ -622,7 +622,7 @@ class MTChunks:
z_max = z * self.chunk_size + self.chunk_size - 1 z_max = z * self.chunk_size + self.chunk_size - 1
#print ("generating x = " + str(x_min) + " to " + str(x_max) + " , z = " + str(z_min) + " to " + str(z_max)) #print ("generating x = " + str(x_min) + " to " + str(x_max) + " , z = " + str(z_min) + " to " + str(z_max))
geometry_value_string = str(x_min)+":"+str(z_min)+"+"+str(int(x_max)-int(x_min))+"+"+str(int(z_max)-int(z_min)) geometry_value_string = str(x_min)+":"+str(z_min)+"+"+str(int(x_max)-int(x_min)+1)+"+"+str(int(z_max)-int(z_min)+1) # +1 since max-min is exclusive and width must be inclusive for minetestmapper.py fork
cmd_suffix = "" cmd_suffix = ""
cmd_suffix = " > \""+genresult_path+"\"" cmd_suffix = " > \""+genresult_path+"\""
output_type_string = "minetestmapper-numpy" output_type_string = "minetestmapper-numpy"

8
minetestmapper.py

@ -214,9 +214,9 @@ if geometry_string is not None:
this_width = int(width_string) this_width = int(width_string)
this_height = int(height_string) this_height = int(height_string)
nonchunky_xmin = x nonchunky_xmin = x
nonchunky_xmax = nonchunky_xmin + this_width nonchunky_xmax = nonchunky_xmin + this_width - 1 # -1 since max is inclusive rect
nonchunky_zmin = z nonchunky_zmin = z
nonchunky_zmax = nonchunky_zmin + this_height nonchunky_zmax = nonchunky_zmin + this_height - 1 # -1 since max is inclusive rect
print("#geometry:") print("#geometry:")
print("# x:"+str(x)) print("# x:"+str(x))
print("# z:"+str(z)) print("# z:"+str(z))
@ -348,9 +348,9 @@ if os.path.exists(path + "map.sqlite"):
x, y, z = getIntegerAsBlock(r[0]) x, y, z = getIntegerAsBlock(r[0])
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)

Loading…
Cancel
Save