From 1194a436f55fe97df496d4efe18f4dac991af3d8 Mon Sep 17 00:00:00 2001 From: Migratingcocofruit <69551563+Migratingcocofruit@users.noreply.github.com> Date: Thu, 3 Apr 2025 16:39:59 +0300 Subject: [PATCH] Fixes certain atmos devices appearing wrong when unwrenched (#28757) * Fixes certain atmos device subtypes not being handled properly when unwrenched * review changes --- code/game/machinery/pipe/pipe_construction.dm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/pipe/pipe_construction.dm b/code/game/machinery/pipe/pipe_construction.dm index d36940e0299..796acf2a80c 100644 --- a/code/game/machinery/pipe/pipe_construction.dm +++ b/code/game/machinery/pipe/pipe_construction.dm @@ -106,7 +106,15 @@ GLOBAL_LIST_INIT(pipe_path2type, list( if(make_from.initialize_directions in list(NORTH|WEST, NORTH|EAST, SOUTH|WEST, SOUTH|EAST)) is_bent = TRUE - pipe_type = GLOB.pipe_path2type[makes_type] + is_bent + // If our path is in the list use the list + if(makes_type in GLOB.pipe_path2type) + pipe_type = GLOB.pipe_path2type[makes_type] + is_bent + // If our path isn't exactly in the list (e.g /obj/machinery/atmospherics/binary/pump/on) try and find an ancestor there + else + for(var/type_path in GLOB.pipe_path2type) + if(ispath(makes_type, type_path)) + pipe_type = GLOB.pipe_path2type[type_path] + is_bent + break switch(pipe_type) if(PIPE_SUPPLY_STRAIGHT, PIPE_SUPPLY_BENT, PIPE_SUPPLY_MANIFOLD, PIPE_SUPPLY_MANIFOLD4W, PIPE_SUPPLY_CAP)