mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 07:59:01 +01:00
Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
|
||||
You can use "MAP <expression>" to run some code per object and use the result. For example:
|
||||
|
||||
"SELECT /obj/machinery/power/smes MAP [charge / capacity * 100, RCon_tag, src]"
|
||||
"SELECT /obj/structure/machinery/power/smes MAP [charge / capacity * 100, RCon_tag, src]"
|
||||
|
||||
This will give you a list of all the APCs, their charge AND RCon tag. Useful eh?
|
||||
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
|
||||
to_chat(usr, "Checking for disconnected pipes...")
|
||||
//all plumbing - yes, some things might get stated twice, doesn't matter.
|
||||
for (var/obj/machinery/atmospherics/plumbing in world)
|
||||
for (var/obj/structure/machinery/atmospherics/plumbing in world)
|
||||
if (plumbing.nodealert)
|
||||
to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")
|
||||
|
||||
//Manifolds
|
||||
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
|
||||
for (var/obj/structure/machinery/atmospherics/pipe/manifold/pipe in world)
|
||||
if (!pipe.node1 || !pipe.node2 || !pipe.node3)
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
|
||||
|
||||
//Pipes
|
||||
for (var/obj/machinery/atmospherics/pipe/simple/pipe in world)
|
||||
for (var/obj/structure/machinery/atmospherics/pipe/simple/pipe in world)
|
||||
if (!pipe.node1 || !pipe.node2)
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
for(var/turf/T in world)
|
||||
for(var/dir in GLOB.cardinals)
|
||||
var/alist/connect_types = alist(1 = 0, 2 = 0, 3 = 0)
|
||||
for(var/obj/machinery/atmospherics/pipe in T)
|
||||
for(var/obj/structure/machinery/atmospherics/pipe in T)
|
||||
if(dir & pipe.initialize_directions)
|
||||
for(var/connect_type in pipe.connect_types)
|
||||
connect_types[connect_type] += 1
|
||||
|
||||
@@ -209,27 +209,27 @@
|
||||
if(!(A.type in areas_all))
|
||||
areas_all.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/power/apc/APC in world)
|
||||
for(var/obj/structure/machinery/power/apc/APC in world)
|
||||
var/area/A = get_area(APC)
|
||||
if(!(A.type in areas_with_APC))
|
||||
areas_with_APC.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/alarm/alarm in world)
|
||||
for(var/obj/structure/machinery/alarm/alarm in world)
|
||||
var/area/A = get_area(alarm)
|
||||
if(!(A.type in areas_with_air_alarm))
|
||||
areas_with_air_alarm.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/requests_console/RC in world)
|
||||
for(var/obj/structure/machinery/requests_console/RC in world)
|
||||
var/area/A = get_area(RC)
|
||||
if(!(A.type in areas_with_RC))
|
||||
areas_with_RC.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/light/L in world)
|
||||
for(var/obj/structure/machinery/light/L in world)
|
||||
var/area/A = get_area(L)
|
||||
if(!(A.type in areas_with_light))
|
||||
areas_with_light.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/light_switch/LS in world)
|
||||
for(var/obj/structure/machinery/light_switch/LS in world)
|
||||
var/area/A = get_area(LS)
|
||||
if(!(A.type in areas_with_LS))
|
||||
areas_with_LS.Add(A.type)
|
||||
@@ -239,7 +239,7 @@
|
||||
if(!(A.type in areas_with_intercom))
|
||||
areas_with_intercom.Add(A.type)
|
||||
|
||||
for(var/obj/machinery/camera/C in world)
|
||||
for(var/obj/structure/machinery/camera/C in world)
|
||||
var/area/A = get_area(C)
|
||||
if(!(A.type in areas_with_camera))
|
||||
areas_with_camera.Add(A.type)
|
||||
|
||||
@@ -56,7 +56,7 @@ GLOBAL_VAR_INIT(intercom_range_display_status, 0)
|
||||
qdel(C)
|
||||
|
||||
if(GLOB.camera_range_display_status)
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
for(var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
new/obj/effect/debugging/camera_range(C.loc)
|
||||
feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -70,19 +70,19 @@ GLOBAL_VAR_INIT(intercom_range_display_status, 0)
|
||||
alert(usr,"Master_controller not found.","Sec Camera Report")
|
||||
return 0
|
||||
|
||||
var/list/obj/machinery/camera/CL = list()
|
||||
var/list/obj/structure/machinery/camera/CL = list()
|
||||
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
for(var/obj/structure/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
if (isturf(C.loc))
|
||||
CL += C
|
||||
|
||||
var/output = {"<B>CAMERA ANNOMALITIES REPORT</B><HR>
|
||||
<B>The following annomalities have been detected. The ones in red need immediate attention: Some of those in black may be intentional.</B><BR><ul>"}
|
||||
|
||||
for(var/obj/machinery/camera/C1 in CL)
|
||||
for(var/obj/structure/machinery/camera/C1 in CL)
|
||||
if(C1.c_tag == null)
|
||||
output += "<li><span class='warning'>null c_tag for sec camera at \[[C1.x], [C1.y], [C1.z]\] ([C1.loc.loc])</span></li>"
|
||||
for(var/obj/machinery/camera/C2 in CL)
|
||||
for(var/obj/structure/machinery/camera/C2 in CL)
|
||||
if(C1 != C2)
|
||||
if(C1.c_tag == C2.c_tag)
|
||||
output += "<li><span class='warning'>c_tag match for sec. cameras at \[[C1.x], [C1.y], [C1.z]\] ([C1.loc.loc]) and \[[C2.x], [C2.y], [C2.z]\] ([C2.loc.loc]) - c_tag is [C1.c_tag]</span></li>"
|
||||
@@ -406,7 +406,7 @@ var/global/movement_disabled_exception //This is the client that calls the proc,
|
||||
set category = "Mapping"
|
||||
set name = "Find Bad Doors"
|
||||
|
||||
for(var/obj/machinery/door/airlock/A in world)
|
||||
for(var/obj/structure/machinery/door/airlock/A in world)
|
||||
var/turf/T = get_turf(A)
|
||||
if(istype(T, /turf/space) || istype(T, /turf/simulated/floor/exoplanet/asteroid) || isopenturf(T) || T.density)
|
||||
to_chat(usr, "Airlock [A] with bad turf at ([A.x],[A.y],[A.z]) in [T.loc].")
|
||||
@@ -415,10 +415,10 @@ var/global/movement_disabled_exception //This is the client that calls the proc,
|
||||
set category = "Mapping"
|
||||
set name = "Find Bad Fire Doors"
|
||||
|
||||
for(var/obj/machinery/door/firedoor/F in world)
|
||||
for(var/obj/structure/machinery/door/firedoor/F in world)
|
||||
var/turf/T = get_turf(F)
|
||||
var/firelock_increment = 0
|
||||
for(var/obj/machinery/door/firedoor/FD in T)
|
||||
for(var/obj/structure/machinery/door/firedoor/FD in T)
|
||||
firelock_increment += 1
|
||||
if(firelock_increment > 1)
|
||||
to_chat(usr, "Double firedoor [F] at ([F.x],[F.y],[F.z]) in [T.loc].")
|
||||
|
||||
Reference in New Issue
Block a user