reworked/verbosified some zas debugging, added additional zas debugging, made kill_air available to game_admins as well as game_masters, increased runtime check sensitivity to aid in debugging

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-08-09 18:12:59 +10:00
parent 15fa23331b
commit dca3f3bd8a
4 changed files with 50 additions and 28 deletions
+7 -7
View File
@@ -171,14 +171,14 @@ datum
proc/tick()
. = 1 //Set the default return value, for runtime detection.
tick_progress = 0
tick_progress = "next_stat_check (atmos statistics)"
if(current_cycle >= next_stat_check)
var/zone/z = pick(zones)
var/log_file = file("[time2text(world.timeofday, "statistics/DD-MM-YYYY-air.txt")]")
log_file << "\"\The [get_area(pick(z.contents))]\",[z.air.oxygen],[z.air.nitrogen],[z.air.carbon_dioxide],[z.air.toxins],[z.air.temperature],[z.air.group_multiplier * z.air.volume]"
next_stat_check = current_cycle + (rand(5,7)*60)
tick_progress = 1
tick_progress = "update_air_properties"
if(tiles_to_update.len) //If there are tiles to update, do so.
for(var/turf/simulated/T in tiles_to_update)
var/output = T.update_air_properties()
@@ -187,19 +187,19 @@ datum
log_admin("ZASALERT: Either a null turf in list/tiles_to_update, or unable run turf/simualted/update_air_properties()")
tiles_to_update = list()
tick_progress = 2
tick_progress = "connections_to_check"
if(connections_to_check.len)
for(var/connection/C in connections_to_check)
C.CheckPassSanity()
connections_to_check = list()
tick_progress = 3
tick_progress = "tiles_to_reconsider_zones"
if(tiles_to_reconsider_zones.len)
for(var/turf/simulated/T in tiles_to_reconsider_zones)
if(!T.zone)
new /zone(T)
tick_progress = 4
tick_progress = "zone/process()"
for(var/zone/Z in zones)
if(Z.last_update < current_cycle)
var/output = Z.process()
@@ -209,11 +209,11 @@ datum
. = 0
log_admin("ZASALERT: Either a null zone in list/zones, or unable run zone/process()")
tick_progress = 5
tick_progress = "active_hotspots (fire)"
for(var/obj/fire/F in active_hotspots)
var/output = F.process()
if(. && F && !output)
. = 0
log_admin("ZASALERT: Either a null fire in list/active_hotspots, or unable run obj/fire/process()")
tick_progress = 6
tick_progress = "success"
+38
View File
@@ -1,9 +1,18 @@
#define QUANTIZE(variable) (round(variable,0.0001))
zone/var/progress = "nothing"
zone/proc/process()
. = 1
progress = "problem with: src.SoftDelete()"
//Deletes zone if empty.
if(!contents.len)
return SoftDelete()
progress = "problem with: src.Rebuild()"
//Does rebuilding stuff.
if(rebuild)
rebuild = 0
@@ -12,12 +21,16 @@ zone/proc/process()
if(!contents.len) //If we got soft deleted.
return
progress = "problem with: src.air.adjust()"
//Sometimes explosions will cause the air to be deleted for some reason.
if(!air)
air = new()
air.adjust(MOLES_O2STANDARD, 0, MOLES_N2STANDARD, 0, list())
world.log << "Air object lost in zone. Regenerating."
progress = "problem with: calculating total space tiles"
//Counting up space.
var/total_space = 0
@@ -28,6 +41,8 @@ zone/proc/process()
if(space_tiles)
total_space = space_tiles.len
progress = "problem with: src.ShareSpace()"
//Add checks to ensure that we're not sucking air out of an empty room.
if(total_space && air.total_moles > 0.1 && air.temperature > TCMB+0.5)
//If there is space, air should flow out of the zone.
@@ -35,11 +50,15 @@ zone/proc/process()
AirflowSpace(src)
ShareSpace(air,total_space*vsc.zone_share_percent/200)
progress = "problem with: src.air.react()"
//React the air here.
air.react(null,0)
//Check the graphic.
progress = "problem with: modifying turf graphics"
air.graphic = 0
if(air.toxins > MOLES_PLASMA_VISIBLE)
air.graphic = 1
@@ -48,9 +67,13 @@ zone/proc/process()
if(sleeping_agent && (sleeping_agent.moles > 1))
air.graphic = 2
progress = "problem with an inbuilt byond function: some conditional checks"
//Only run through the individual turfs if there's reason to.
if(air.graphic != air.graphic_archived || air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
progress = "problem with: turf/simulated/update_visuals()"
for(var/turf/simulated/S in contents)
//Update overlays.
if(air.graphic != air.graphic_archived)
@@ -59,20 +82,31 @@ zone/proc/process()
else
S.update_visuals(air)
progress = "problem with: item or turf temperature_expose()"
//Expose stuff to extreme heat.
if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
for(var/atom/movable/item in S)
item.temperature_expose(air, air.temperature, CELL_VOLUME)
S.temperature_expose(air, air.temperature, CELL_VOLUME)
progress = "problem with: calculating air graphic"
//Archive graphic so we can know if it's different.
air.graphic_archived = air.graphic
progress = "problem with: calculating air temp"
//Ensure temperature does not reach absolute zero.
air.temperature = max(TCMB,air.temperature)
progress = "problem with an inbuilt byond function: length(connections)"
//Handle connections to other zones.
if(length(connections))
progress = "problem with: src.ZMerge(), a couple of misc procs"
for(var/connection/C in connections)
//Check if the connection is valid first.
if(!C.Cleanup())
@@ -84,6 +118,8 @@ zone/proc/process()
if(C.A.zone.air.compare(C.B.zone.air) || total_space)
ZMerge(C.A.zone,C.B.zone)
progress = "problem with: src.ShareRatio(), src.Airflow(), a couple of misc procs"
//Share some
for(var/zone/Z in connected_zones)
if(air && Z.air)
@@ -95,6 +131,8 @@ zone/proc/process()
//Divided by 200 since each zone is processed. Each connection is considered twice
//Space tiles force it to try and move twice as much air.
progress = "all components completed successfully, the problem is not here"
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, ratio)
//Shares a specific ratio of gas between mixtures using simple weighted averages.
var