Some sanity (to a stupid degree) on flood filling turfs.

This commit is contained in:
SkyMarshal
2012-06-06 01:48:24 -07:00
parent 6c9baab84c
commit 01d9308397
2 changed files with 10 additions and 7 deletions

View File

@@ -12,9 +12,15 @@ zone/proc/process()
//Choose a random turf and regenerate the zone from it.
var
turf/sample = pick(contents)
list/new_contents = FloodFill(sample)
list/new_contents
problem = 0
contents.Remove(null) //I can't believe this is needed.
do
sample = pick(contents) //Nor this.
while(!istype(sample))
new_contents = FloodFill(sample)
//If something isn't carried over, there was a complication.
for(var/turf/T in contents)
if(!(T in new_contents))
@@ -27,15 +33,10 @@ zone/proc/process()
contents -= T
rebuild_turfs += T
T.zone = null
var/zone/Z
for(var/turf/T in rebuild_turfs)
if(!T.zone)
var/list/flood_fill = FloodFill(T)
Z = new /zone()
var/zone/Z = new /zone(T)
Z.air.copy_from(air)
for(var/turf/NT in flood_fill)
Z.AddTurf(NT)
rebuild = 0
//Sometimes explosions will cause the air to be deleted for some reason.