Fixes the scope of the 4 Continue statements to correctly end the turfPath and atomPath loops, Corrects define bitflags

This commit is contained in:
Remie Richards
2015-05-01 08:13:47 +01:00
committed by Tigercat2000
parent 88faef42ea
commit b2bba39a68
4 changed files with 35 additions and 25 deletions
@@ -11,11 +11,11 @@
//Combined defines
#define CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster
#define CLUSTER_CHECK_DIFFERENTS 6 //Don't let any of different types cluster
#define CLUSTER_CHECK_ALL_TURFS 32 //Don't let ANY turfs cluster same and different types
#define CLUSTER_CHECK_ALL_ATOMS 64 //Don't let ANY atoms cluster same and different types
#define CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types
#define CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types
//All
#define CLUSTER_CHECK_ALL 96 //Don't let anything cluster, like, at all
#define CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all
/datum/mapGenerator
@@ -5,7 +5,7 @@
var/list/spawnableTurfs = list()
var/clusterMax = 5
var/clusterMin = 1
var/clusterCheckFlags = CLUSTER_CHECK_ALL_ATOMS
var/clusterCheckFlags = CLUSTER_CHECK_SAME_ATOMS
var/allowAtomsOnSpace = FALSE
@@ -31,6 +31,7 @@
return 0
var/clustering = 0
var/skipLoopIteration = FALSE
//Turfs don't care whether atoms can be placed here
for(var/turfPath in spawnableTurfs)
@@ -42,20 +43,23 @@
if(clusterCheckFlags & CLUSTER_CHECK_SAME_TURFS)
clustering = rand(clusterMin,clusterMax)
for(var/turf/F in trange(clustering,T))
//if(F.type == turfPath) //NOT istype(), exact typematching
if(istype(F,turfPath))
continue
if(locate(turfPath) in trange(clustering, T))
skipLoopIteration = TRUE
break
if(skipLoopIteration)
skipLoopIteration = FALSE
continue
//You're DIFFERENT to me? I hate you I'm going home
if(clusterCheckFlags & CLUSTER_CHECK_DIFFERENT_TURFS)
clustering = rand(clusterMin,clusterMax)
for(var/turf/F in trange(clustering,T))
//if(F.type != turfPath)
if(!(istype(F,turfPath)))
continue
skipLoopIteration = TRUE
break
if(skipLoopIteration)
skipLoopIteration = FALSE
continue
//Success!
if(prob(spawnableTurfs[turfPath]))
@@ -74,17 +78,23 @@
if(clusterCheckFlags & CLUSTER_CHECK_SAME_ATOMS)
clustering = rand(clusterMin, clusterMax)
for(var/atom/movable/M in range(clustering,T))
//if(M.type == atomPath)
if(istype(M,atomPath))
continue
skipLoopIteration = TRUE
break
if(skipLoopIteration)
skipLoopIteration = FALSE
continue
//You're DIFFERENT from me? I hate you I'm going home
if(clusterCheckFlags & CLUSTER_CHECK_DIFFERENT_ATOMS)
clustering = rand(clusterMin, clusterMax)
for(var/atom/movable/M in range(clustering,T))
//if(M.type != atomPath)
if(!(istype(M,atomPath)))
continue
skipLoopIteration = TRUE
break
if(skipLoopIteration)
skipLoopIteration = FALSE
continue
//Success!
if(prob(spawnableAtoms[atomPath]))
@@ -126,11 +136,11 @@
//Settings appropriate for turfs/atoms that cover SOME of the map region, sometimes referred to as a splatter layer.
/datum/mapGeneratorModule/splatterLayer
clusterCheckFlags = CLUSTER_CHECK_ALL
spawnableAtoms = list(/atom = 15)
spawnableTurfs = list(/turf = 15)
spawnableAtoms = list(/atom = 30)
spawnableTurfs = list(/turf = 30)
//Settings appropriate for turfs/atoms that cover a lot of the map region, eg a dense forest.
/datum/mapGeneratorModule/denseLayer
clusterCheckFlags = CLUSTER_CHECK_NONE
spawnableAtoms = list(/atom = 35)
spawnableTurfs = list(/turf = 35)
spawnableAtoms = list(/atom = 75)
spawnableTurfs = list(/turf = 75)
@@ -4,11 +4,11 @@
//Pine Trees
/datum/mapGeneratorModule/pineTrees
spawnableAtoms = list(/obj/structure/flora/tree/pine = 15)
spawnableAtoms = list(/obj/structure/flora/tree/pine = 30)
//Dead Trees
/datum/mapGeneratorModule/deadTrees
spawnableAtoms = list(/obj/structure/flora/tree/dead = 5)
spawnableAtoms = list(/obj/structure/flora/tree/dead = 10)
//Random assortment of bushes
/datum/mapGeneratorModule/randBushes
@@ -18,7 +18,7 @@
..()
spawnableAtoms = typesof(/obj/structure/flora/ausbushes)
for(var/i in spawnableAtoms)
spawnableAtoms[i] = 15
spawnableAtoms[i] = 20
//Random assortment of rocks and rockpiles
@@ -34,4 +34,4 @@
//Grass tufts with a high spawn chance
/datum/mapGeneratorModule/denseLayer/grassTufts
spawnableTurfs = list()
spawnableAtoms = list(/obj/structure/flora/ausbushes/grassybush = 35)
spawnableAtoms = list(/obj/structure/flora/ausbushes/grassybush = 75)
@@ -136,10 +136,10 @@ Variable Breakdown (For Mappers):
CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster
CLUSTER_CHECK_DIFFERENTS 6 //Don't let any different types cluster
CLUSTER_CHECK_ALL_TURFS 32 //Don't let ANY turfs cluster same and different types
CLUSTER_CHECK_ALL_ATOMS 64 //Don't let ANY atoms cluster same and different types
CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types
CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types
CLUSTER_CHECK_ALL 96 //Don't let anything cluster, like, at all
CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all