From 05bd27d7773410470bc4d53ac8bc2110ca91aac9 Mon Sep 17 00:00:00 2001 From: Cael_Aislinn Date: Fri, 1 Feb 2013 23:07:28 +1000 Subject: [PATCH] re-enabled air profiling, some tweaks to turf changes to resolve outstanding issues (will be overwritten by master) Signed-off-by: Cael_Aislinn --- code/controllers/master_controller.dm | 9 +++----- code/game/turfs/turf.dm | 33 +++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 67d714a6c77..045f1832159 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -113,10 +113,9 @@ datum/controller/game_controller/proc/process() vote.process() //AIR - /*timer = world.timeofday + timer = world.timeofday last_thing_processed = air_master.type - air_master.process() - air_cost = (world.timeofday - timer) / 10*/ + //air_master.process() // this might make atmos slower // 1. atmos won't process if the game is generally lagged out(no deadlocks) @@ -133,9 +132,7 @@ datum/controller/game_controller/proc/process() world << "RUNTIMES IN ATMOS TICKER. Killing air simulation!" kill_air = 1 air_master.failed_ticks = 0 - /*else if (air_master.failed_ticks > 10) - air_master.failed_ticks = 0*/ - //air_master_ready = 1 + air_cost = (world.timeofday - timer) / 10 sleep(breather_ticks) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 854d024fdbe..0812977af06 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -229,21 +229,35 @@ if (istype(W,/turf/simulated/floor)) W.RemoveLattice() + //if the old turf had a zone, connect the new turf to it as well - Cael + if(src.zone) + src.zone.RemoveTurf(src) + W.zone = src.zone + W.zone.AddTurf(W) + W.levelupdate() return W else + + /*if(istype(src, /turf/simulated) && src.zone) + src.zone.rebuild = 1*/ + var/turf/W = new N( locate(src.x, src.y, src.z) ) W.lighting_lumcount += old_lumcount if(old_lumcount != W.lighting_lumcount) W.lighting_changed = 1 lighting_controller.changed_turfs += W + if(src.zone) + src.zone.RemoveTurf(src) + W.zone = src.zone + W.zone.AddTurf(W) + W.levelupdate() return W //////Assimilate Air////// /turf/simulated/proc/Assimilate_Air() - /* var/aoxy = 0//Holders to assimilate air from nearby turfs var/anitro = 0 var/aco = 0 @@ -270,7 +284,22 @@ air.carbon_dioxide = (aco/max(turf_count,1)) air.toxins = (atox/max(turf_count,1)) air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant - */ + air.update_values() + + //cael - duplicate the averaged values across adjacent turfs to enforce a seamless atmos change + 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 + continue + else if(istype(T,/turf/simulated/floor)) + var/turf/simulated/S = T + if(S.air)//Add the air's contents to the holders + S.air.oxygen = air.oxygen + S.air.nitrogen = air.nitrogen + S.air.carbon_dioxide = air.carbon_dioxide + S.air.toxins = air.toxins + S.air.temperature = air.temperature + S.air.update_values() /turf/proc/ReplaceWithLattice() src.ChangeTurf(/turf/space)