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:
Batrachophreno
2026-05-26 19:35:48 +00:00
committed by GitHub
parent d8e02149e0
commit 4ecb0bc21c
1102 changed files with 114406 additions and 114428 deletions
@@ -32,7 +32,7 @@ GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new)
/datum/ntnet/New()
if(GLOB.ntnet_global && (GLOB.ntnet_global != src))
GLOB.ntnet_global = src // There can be only one.
for(var/obj/machinery/ntnet_relay/R in SSmachinery.machinery)
for(var/obj/structure/machinery/ntnet_relay/R in SSmachinery.machinery)
relays.Add(R)
R.NTNet = src
build_software_lists()
@@ -70,7 +70,7 @@ GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new)
var/operating = FALSE
// Check all relays. If we have at least one working relay, network is up.
for(var/obj/machinery/ntnet_relay/R in relays)
for(var/obj/structure/machinery/ntnet_relay/R in relays)
if(R.operable())
operating = TRUE
break
@@ -1,5 +1,5 @@
// Relays don't handle any actual communication. Global NTNet datum does that, relays only tell the datum if it should or shouldn't work.
/obj/machinery/ntnet_relay
/obj/structure/machinery/ntnet_relay
name = "NTNet Quantum Relay"
desc = "A very complex router and transmitter capable of connecting electronic devices together. Looks fragile."
use_power = POWER_USE_ACTIVE
@@ -25,7 +25,7 @@
)
// TODO: Implement more logic here. For now it's only a placeholder.
/obj/machinery/ntnet_relay/operable()
/obj/structure/machinery/ntnet_relay/operable()
if(!..(EMPED))
return FALSE
if(dos_failure)
@@ -34,7 +34,7 @@
return FALSE
return TRUE
/obj/machinery/ntnet_relay/update_icon()
/obj/structure/machinery/ntnet_relay/update_icon()
ClearOverlays()
if(operable())
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
@@ -48,7 +48,7 @@
if(panel_open)
AddOverlays("[icon_state]_panel")
/obj/machinery/ntnet_relay/process()
/obj/structure/machinery/ntnet_relay/process()
if(operable())
update_use_power(POWER_USE_ACTIVE)
else
@@ -69,13 +69,13 @@
GLOB.ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
..()
/obj/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
/obj/structure/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "NTNetRelay")
ui.open()
/obj/machinery/ntnet_relay/ui_data(mob/user)
/obj/structure/machinery/ntnet_relay/ui_data(mob/user)
var/list/data = list()
data["enabled"] = enabled
data["dos_capacity"] = dos_capacity
@@ -84,7 +84,7 @@
return data
/obj/machinery/ntnet_relay/ui_act(action, params)
/obj/structure/machinery/ntnet_relay/ui_act(action, params)
. = ..()
if(.)
return
@@ -100,10 +100,10 @@
update_icon()
. = TRUE
/obj/machinery/ntnet_relay/attack_hand(var/mob/living/user)
/obj/structure/machinery/ntnet_relay/attack_hand(var/mob/living/user)
ui_interact(user)
/obj/machinery/ntnet_relay/Initialize()
/obj/structure/machinery/ntnet_relay/Initialize()
. = ..()
uid = gl_uid
gl_uid++
@@ -115,13 +115,13 @@
NTNet = GLOB.ntnet_global
GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
/obj/machinery/ntnet_relay/Destroy()
/obj/structure/machinery/ntnet_relay/Destroy()
if(GLOB.ntnet_global)
GLOB.ntnet_global.relays.Remove(src)
GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
return ..()
/obj/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
/obj/structure/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
panel_open = !panel_open
@@ -136,7 +136,7 @@
for(var/atom/movable/A in component_parts)
A.forceMove(get_turf(src))
new /obj/machinery/constructable_frame/machine_frame(get_turf(src))
new /obj/structure/machinery/constructable_frame/machine_frame(get_turf(src))
qdel(src)
return
..()