var/global/datum/controller/generator/map_generator/mapgenerator //Set in world.New()
var/list/turflist = list() // Pre-generate this list when initializing for quicker setup.
var/list/completedtiles = list()
var/list/minerals = new/list(
world.log << "HAI THERE"
for(var/turf/walls/mineral/M in minerals)
M = new(locate(1, 1, 1))
var/rarity = M.rarity
var/turf/spawnloc = pick(turflist)
world.log << "While Loop"
M = new(spawnloc)
It doesn't work. I can see the 'HAI THERE' message appear, but it never gets to the 'While Loop' part.
The line after the for loop was added because It was incapable of finding M.rarity (null), even when I gave it the mineral type directly.
I'm at a loss here, and could use some help.