ID:139786
 
Code:
mob
proc
spawnobjs()
var/spawned = 0
var/list/turfspawns = list()
while(spawned <= 15)
for(var/turf/Arm1/noMobs/A in oview(8,src))
spawnspot += A
new /obj/arrancarsuit(pick(turfspawns))
spawned++


Problem description:
Well, the code above does everything I want it to do; spawn a certain number of objects on certain turfs. However, sometimes it spawns more than one object on a turf. I've tried a few things but none of them seem to work, can anyone help?
If you do not want to have two objects in the same place, take away the turf it was spawned at (after revising your procedure so the while is after your for())
for(...)
Get list of turfs

while(spawn...)
var/turf/t = pick(turf list)
new/object(t)
turf list -= t
In response to GhostAnime
Thanks, Ghost. Works like a charm ^^
Also this is the ideal situation for a for() loop. It should be for(var/spawned = 0, spawned < 15, ++spawned), and you should remove the other var/spawned and spawned++ lines.