From 9d8e8573b49a0c10c3d3ea981cefeb4eb89be79c Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Sun, 6 Feb 2011 03:33:01 +0000 Subject: [PATCH] Mappers, this one's for you. New debug verb added for Coders and Hosts, when pressed, it goes through every obj/machinery/atmospherics in the map, and lists all of the ones that have the nodealert var set to 1, which should only be the case if not all the nodes are connected to something. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@970 316c924e-a436-60f5-8080-3fe189b3f50e --- code/ATMOSPHERICS/atmospherics.dm | 2 +- code/ATMOSPHERICS/components/valve.dm | 17 ++++++++++++--- code/ATMOSPHERICS/pipes.dm | 29 +++++++++++++++++++++++--- code/modules/admin/admin_verbs.dm | 3 +++ code/modules/admin/verbs/atmosdebug.dm | 10 +++++++++ tgstation.dme | 1 + 6 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 code/modules/admin/verbs/atmosdebug.dm diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 75d233eb467..429efd6d979 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -14,7 +14,7 @@ obj/machinery/atmospherics anchored = 1 power_usage = 10 power_channel = ENVIRON - + var/nodealert = 0 var/initialize_directions = 0 var/color diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 6ba11adc6a6..4ddbf49ccf5 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -106,7 +106,7 @@ obj/machinery/atmospherics/valve build_network() return 1 - + proc/normalize_dir() if(dir==3) dir = 1 @@ -131,6 +131,17 @@ obj/machinery/atmospherics/valve ..() if(open && (!node1 || !node2)) close() + if(!node1) + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 + else if (!node2) + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 + else if (nodealert) + nodealert = 0 + return @@ -139,14 +150,14 @@ obj/machinery/atmospherics/valve var/node1_dir var/node2_dir - + for(var/direction in cardinal) if(direction&initialize_directions) if (!node1_dir) node1_dir = direction else if (!node2_dir) node2_dir = direction - + for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir)) if(target.initialize_directions & get_dir(target,src)) node1 = target diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 68cae4b272d..6ae9e361e12 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -5,7 +5,7 @@ obj/machinery/atmospherics/pipe var/datum/pipeline/parent var/volume = 0 - var/nodealert = 0 + layer = 2.4 //under wires with their 2.5 @@ -118,6 +118,8 @@ obj/machinery/atmospherics/pipe if(!nodealert) //world << "Missing node from [src] at [src.x],[src.y],[src.z]" nodealert = 1 + else if (nodealert) + nodealert = 0 else if(parent) @@ -342,6 +344,11 @@ obj/machinery/atmospherics/pipe ..() if(!node1) parent.mingle_with_turf(loc, 200) + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 + else if (nodealert) + nodealert = 0 carbon_dioxide name = "Pressure Tank (Carbon Dioxide)" @@ -515,6 +522,13 @@ obj/machinery/atmospherics/pipe if(parent) parent.mingle_with_turf(loc, 250) + if(!node1) + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 + else if (nodealert) + nodealert = 0 + Del() if(node1) node1.disconnect(src) @@ -606,12 +620,21 @@ obj/machinery/atmospherics/pipe if(!node1) parent.mingle_with_turf(loc, 70) - + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 else if(!node2) parent.mingle_with_turf(loc, 70) - + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 else if(!node3) parent.mingle_with_turf(loc, 70) + if(!nodealert) + //world << "Missing node from [src] at [src.x],[src.y],[src.z]" + nodealert = 1 + else if (nodealert) + nodealert = 0 Del() if(node1) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d20a73012bb..7a6b6e28149 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -28,6 +28,7 @@ src.holder.level = 6 // Settings + src.verbs += /client/proc/colorooc // -- Urist src.verbs += /obj/admins/proc/adjump //toggle admin jumping src.verbs += /obj/admins/proc/adrev //toggle admin revives @@ -62,6 +63,7 @@ src.verbs += /obj/admins/proc/startnow //start now bitch // Debug + src.verbs += /client/proc/atmosscan //for locating piping breaks src.verbs += /client/proc/debug_variables src.verbs += /client/proc/cmd_modify_object_variables src.verbs += /client/proc/cmd_modify_ticker_variables @@ -188,6 +190,7 @@ src.verbs += /obj/admins/proc/startnow //start now bitch // Debug + src.verbs += /client/proc/atmosscan //for locating piping breaks src.verbs += /client/proc/debug_variables src.verbs += /client/proc/cmd_modify_object_variables src.verbs += /client/proc/cmd_modify_ticker_variables diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm new file mode 100644 index 00000000000..f3747d07ee1 --- /dev/null +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -0,0 +1,10 @@ +/client/proc/atmosscan() + set category = "Debug" + set name = "Check Plumbing" + if(!src.authenticated || !src.holder) + src << "Only administrators may use this command." + return + + for (var/obj/machinery/atmospherics/plumbing in world) + if (plumbing.nodealert) + usr << "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])" diff --git a/tgstation.dme b/tgstation.dme index 47cb2c7e719..8e99a0861a6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -601,6 +601,7 @@ #include "code\modules\admin\verbs\adminhelp.dm" #include "code\modules\admin\verbs\adminjump.dm" #include "code\modules\admin\verbs\adminsay.dm" +#include "code\modules\admin\verbs\atmosdebug.dm" #include "code\modules\admin\verbs\changetemperature.dm" #include "code\modules\admin\verbs\deadsay.dm" #include "code\modules\admin\verbs\debug.dm"