Createa()
set name = ".create2"
var/n = winget(usr, "window3.button6", "is-checked")
var/g = winget(usr, "window3.button7", "is-checked")
if(n == TRUE)
world.maxz+=1
var/p = world.maxz
usr.createdz=p
for(var/turf/A in world)
if(!istype(A, /turf/ground))
if(A.z == p)
new/turf/ground(A.loc)
// world << T
world << "A MADE"
winset(usr, null, "window3.is-visible=false")
winset(usr, null, "window1.is-visible=true")
return
if(g == TRUE)
world.maxz+=1
var/p = world.maxz
usr.createdz=p
for(var/turf/T in world)
if(!istype(T, /turf/ground2))
if(T.z == p)
new/turf/ground2(locate(T.x, T.y, T.z))
world << "B MADE"
winset(usr, null, "window3.is-visible=false")
winset(usr, null, "window1.is-visible=true")
return
Problem description:
Well, the code is supposed to get where either one of two radios are checked, then it creates a new maxz and is supposed to create a turf of specific type on each normal turf in the new z level.
The world turf var = /turf. The game lags and doesn't create anything, even if I set the maxx/maxy to 10 or a lower value.
Any idea?