flowers:
for(var/turf/T in l)
if(prob(flowerDensity))
for(var/obj/overmap/flower/F in T) continue flowers
new /obj/overmap/flower (T)
l is a list of turfs to check
flowerDensity is set to 100 for testing purposes
The error I get when I compile this code is as follows:
Overmap.dm:24:error:flowers :continue failed
Note that line 24 is marked in the snippet above.
Does anyone know what this error means or what I should do to fix it? Thanks in advance.
-LoW
You could just do this:
For one thing, you don't need to loop since you are only searching for a single one. For another, continue is evil unless really needed, which it is not in this case since something else is better.
Also, you are continuing to a point outside of the loop. I don't do a lot with that sort of nonsense in DM; but I can tell you that it would not work in other programming languages I have used. Perhaps, if you really want to use continue, you could try putting the flowers pointer inside the outside loop.