Made defineRegion() procs additive instead of overwriting, overwriting has been moved to a "replace" argument, adds undefineRegion() which makes the map list a new list.

This commit is contained in:
Remie Richards
2015-04-30 17:56:19 -07:00
committed by Tigercat2000
parent 7a0a724d6c
commit baa758921b
2 changed files with 24 additions and 9 deletions
@@ -13,17 +13,20 @@
//Defines the region the map represents, sets map
//Returns the map
/datum/mapGenerator/proc/defineRegion(var/turf/Start, var/turf/End)
/datum/mapGenerator/proc/defineRegion(var/turf/Start, var/turf/End, var/replace = 0)
if(!checkRegion(Start, End))
return 0
map = block(Start,End)
if(replace)
undefineRegion()
map |= block(Start,End)
return map
//Defines the region the map represents, as a CIRCLE!, sets map
//Returns the map
/datum/mapGenerator/proc/defineCircularRegion(var/turf/Start, var/turf/End)
/datum/mapGenerator/proc/defineCircularRegion(var/turf/Start, var/turf/End, var/replace = 0)
if(!checkRegion(Start, End))
return 0
@@ -34,10 +37,18 @@
var/turf/center = locate(centerX, centerY, centerZ) //spherical maps! because Idk
map = circlerange(center,radius)
if(replace)
undefineRegion()
map |= circlerange(center,radius)
return map
//Empties the map list, he's dead jim.
/datum/mapGenerator/proc/undefineRegion()
map = list() //bai bai
//Checks for and Rejects bad region coordinates
//Returns 1/0
/datum/mapGenerator/proc/checkRegion(var/turf/Start, var/turf/End)