mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
@@ -1160,6 +1160,9 @@ var/list/admin_verbs_mod = list(
|
|||||||
z_coord = input(usr, "Input the Z coordinate. If it's higher than [world.maxz], a new Z-level will be created (X = [x_coord], Y = [y_coord]): ", "Map element loading") as null|num
|
z_coord = input(usr, "Input the Z coordinate. If it's higher than [world.maxz], a new Z-level will be created (X = [x_coord], Y = [y_coord]): ", "Map element loading") as null|num
|
||||||
if(z_coord == null) return
|
if(z_coord == null) return
|
||||||
|
|
||||||
|
x_coord = Clamp(x_coord, 1, world.maxx)
|
||||||
|
y_coord = Clamp(y_coord, 1, world.maxy)
|
||||||
|
|
||||||
if("Cancel")
|
if("Cancel")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
var/list/grid_models = list()
|
var/list/grid_models = list()
|
||||||
var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))//the length of the model key (e.g "aa" or "aba")
|
var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))//the length of the model key (e.g "aa" or "aba")
|
||||||
|
if(!key_len) key_len = 1
|
||||||
|
|
||||||
//proceed line by line
|
//proceed line by line
|
||||||
for(lpos=1; lpos<tfile_len; lpos=findtext(tfile,"\n",lpos,0)+1)
|
for(lpos=1; lpos<tfile_len; lpos=findtext(tfile,"\n",lpos,0)+1)
|
||||||
@@ -64,16 +65,17 @@ var/global/dmm_suite/preloader/_preloader = null
|
|||||||
map.addZLevel(new /datum/zLevel/away, world.maxz) //create a new z_level if needed
|
map.addZLevel(new /datum/zLevel/away, world.maxz) //create a new z_level if needed
|
||||||
|
|
||||||
var/zgrid = copytext(tfile,findtext(tfile,quote+"\n",zpos,0)+2,findtext(tfile,"\n"+quote,zpos,0)+1) //copy the whole map grid
|
var/zgrid = copytext(tfile,findtext(tfile,quote+"\n",zpos,0)+2,findtext(tfile,"\n"+quote,zpos,0)+1) //copy the whole map grid
|
||||||
var/z_depth = length(zgrid)
|
var/z_depth = length(zgrid) //Length of the whole block (with multiple lines in them)
|
||||||
|
|
||||||
//if exceeding the world max x or y, increase it
|
//if exceeding the world max x or y, increase it
|
||||||
var/x_depth = length(copytext(zgrid,1,findtext(zgrid,"\n",2,0)))
|
var/x_depth = length(copytext(zgrid,1,findtext(zgrid,"\n",2,0))) / key_len //This is the length of an encoded line (like "aaaaaaaaBBBBaaaaccccaaa"). It must be divided by the length of the key
|
||||||
if(world.maxx<x_depth)
|
|
||||||
world.maxx=x_depth
|
if(world.maxx < x_depth + x_offset)
|
||||||
|
world.maxx = x_depth + x_offset
|
||||||
|
|
||||||
var/y_depth = z_depth / (x_depth+1) //x_depth + 1 because we're counting the '\n' characters in z_depth
|
var/y_depth = z_depth / (x_depth+1) //x_depth + 1 because we're counting the '\n' characters in z_depth
|
||||||
if(world.maxy<y_depth)
|
if(world.maxy < y_depth + y_offset)
|
||||||
world.maxy=y_depth
|
world.maxy = y_depth + y_offset
|
||||||
|
|
||||||
//then proceed it line by line, starting from top
|
//then proceed it line by line, starting from top
|
||||||
ycrd = y_offset + y_depth
|
ycrd = y_offset + y_depth
|
||||||
|
|||||||
Reference in New Issue
Block a user