ID:140034
 
Code:
structure
New()
world << "A <b>[type]</b> was created."
..()
Del()
world << "A <b>[type]</b> was deleted."
..()
column
var
loc_x=0
loc_y=0
proc/Generate_columns(cell_size_x,cell_size_y)
for(var/turf/a in world)
if(a.x==1||a.x==world.maxx||a.y==1||a.y==world.maxy) continue
if((a.x-1)%cell_size_x==0&&(a.y-1)%cell_size_y==0)
new/turf/wall/brick_wall(a)
var/structure/column/c = new()
c.loc_x = a.x
c.loc_y = a.y


Problem description:
This code is part of a dungeon-generating system.
What this does does is, it looks for all turfs in the world whose coordinates are multiples of cell_size_x and cell_size_y, and then it creates a /structure/column object with the turf's coordinates.

Everytime I run it though, my columns are deleted at the end of the for(var/turf/a in world). As in, they are created within the loop (I get the 'creation' message), but when the loop moves on to the next found turf, the column created in the previous loop is deleted.

Why does this happen?
I may give more info if necessary.

Thanks!
I believe your columns are being picked up by the garbage collector.

Since they are datums thus not actually placed on the map, and there is really no reference made to them they are being deleted.
In response to tidus123
Makes sense.
Thanks a lot, I'll store them somewhere.