From a6ae09bccf13f8842dbc8a3ab838b134e29e2beb Mon Sep 17 00:00:00 2001 From: Cael_Aislinn Date: Fri, 1 Feb 2013 22:49:54 +1000 Subject: [PATCH] fix for some zas runtimes, overrepressurisation after sealing breaches, zones not properly restructuring during some breaches Signed-off-by: Cael_Aislinn --- code/ZAS/ZAS_Zones.dm | 2 +- code/game/turfs/turf.dm | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/ZAS/ZAS_Zones.dm b/code/ZAS/ZAS_Zones.dm index 17867abf266..a6d76a91f70 100644 --- a/code/ZAS/ZAS_Zones.dm +++ b/code/ZAS/ZAS_Zones.dm @@ -409,7 +409,7 @@ zone/proc/Rebuild() // var/list/turfs_to_consider = contents.Copy() - while(!sample.CanPass(null, sample, 1.5, 1)) + while(!sample || !sample.CanPass(null, sample, 1.5, 1)) if(sample) turfs_to_consider.Remove(sample) sample = locate() in turfs_to_consider diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 791b6d2c172..315dd7363e5 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -213,12 +213,12 @@ /turf/proc/ReplaceWithFloor(explode=0) var/prior_icon = icon_old var/old_dir = dir - var/aoxy = 0//Holders to assimilate air from nearby turfs + /*var/aoxy = 0//Holders to assimilate air from nearby turfs var/anitro = 0 var/aco = 0 var/atox = 0 var/atemp = 0 - var/turf_count = 0 + var/turf_count = 0*/ var/old_lumcount = lighting_lumcount - initial(lighting_lumcount) var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) ) @@ -228,6 +228,7 @@ lighting_controller.changed_turfs += W //////Assimilate Air////// + /* for(var/direction in cardinal)//Only use cardinals to cut down on lag var/turf/T = get_step(src,direction) if(istype(T,/turf/space))//Counted as no air @@ -247,6 +248,7 @@ W.air.carbon_dioxide = (aco/max(turf_count,1)) W.air.toxins = (atox/max(turf_count,1)) W.air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant + */ W.RemoveLattice() W.dir = old_dir @@ -259,12 +261,12 @@ /turf/proc/ReplaceWithPlating() var/prior_icon = icon_old var/old_dir = dir - var/aoxy = 0//Holders to assimilate air from nearby turfs + /*var/aoxy = 0//Holders to assimilate air from nearby turfs var/anitro = 0 var/aco = 0 var/atox = 0 var/atemp = 0 - var/turf_count = 0 + var/turf_count = 0*/ //////Assimilate Air////// var/old_lumcount = lighting_lumcount - initial(lighting_lumcount) @@ -274,6 +276,7 @@ W.lighting_changed = 1 lighting_controller.changed_turfs += W + /* for(var/direction in cardinal) var/turf/T = get_step(src,direction) if(istype(T,/turf/space)) @@ -293,6 +296,7 @@ W.air.carbon_dioxide = (aco/max(turf_count,1)) W.air.toxins = (atox/max(turf_count,1)) W.air.temperature = (atemp/max(turf_count,1)) + */ W.RemoveLattice() W.dir = old_dir @@ -321,6 +325,11 @@ /turf/proc/ReplaceWithSpace() var/old_dir = dir + var/zone/Z + if(src.zone) + Z = src.zone + Z.RemoveTurf(src) + var/old_lumcount = lighting_lumcount - initial(lighting_lumcount) var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) ) S.lighting_lumcount += old_lumcount @@ -328,6 +337,11 @@ S.lighting_changed = 1 lighting_controller.changed_turfs += S + if(Z) + //Z.AddTurf(S) + for(var/turf/simulated/T in orange(src,1)) + air_master.tiles_to_update.Add(T) + S.dir = old_dir S.levelupdate() return S