/proc/holocopy (var/area/from_area, var/area/to_area, delay)
var/fmx = world.maxx
var/fmy = world.maxy
var/tmx = world.maxx
var/tmy = world.maxy
var/fmax = 0
var/fmay = 0
var/fz = 0
var/tz = 0
for (var/turf/T in from_area)
if (T.x < fmx) fmx = T.x
if (T.y < fmy) fmy = T.y
if (T.x > fmax) fmax = T.x
if (T.y > fmay) fmay = T.y
fz = T.z
for (var/turf/T in to_area)
if (T.x < tmx) tmx = T.x
if (T.y < tmy) tmy = T.y
tz = T.z
var/flx = fmax - fmx //Fmax >= fmx, guarented
var/fly = fmay - fmy
//First. We have to copy turfs immediately.
for (var/xx=0,xx<=flx,xx++)
for (var/yy=0,yy<=fly,yy++) //XX, YY - offset from FMX, TMX and FMY, TMY respectively.
var/turf/FT = locate(fmx + xx, fmy + yy, fz) //From_zone Turf
var/turf/TT = locate(tmx + xx, tmy + yy, tz) //To_zone Turf
if (FT && TT) //Sanity
if (FT in from_area && TT in to_area)
var/turf/X = new FT.type(TT)
for(var/V in FT.vars)
if(!(V in list("type","loc","locs","vars", "parent", "parent_type","verbs","ckey","key","x","y","z")))
X.vars[V] = FT.vars[V] //From DuplicateObject
Problem description:
So. I can't understand why it never passes through
if (FT in from_area && TT in to_area)
It must get a turf on coordinates X,Y,Z and check that the turf is inside from_area. But i can't understand why none of them don't pass through this check. Maybe the problem inside locate?
P.S. There's an another similar procedure in that game, but it's the way more laggier. While that procedure should take xl*yl operations, another one takes (xl*yl)^2.
so if((bleh in area)&&(bleh2 in area2))