[MIRROR] Fixes HE pipes not respecting layering (#7223)
* Fixes HE pipes not respecting layering (#38468) * HE pipes fix * Heat exchange stuff * Fixes HE pipes not respecting layering
This commit is contained in:
committed by
kevinz000
parent
d0f68daa21
commit
f02a99f901
@@ -125,7 +125,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
pixel_y = (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
|
||||
layer = initial(layer) + ((piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE)
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target)
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging
|
||||
icon = 'icons/obj/atmospherics/pipes/heat.dmi'
|
||||
level = 2
|
||||
var/initialize_directions_he
|
||||
var/minimum_temperature_difference = 20
|
||||
var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
||||
color = "#404040"
|
||||
@@ -9,22 +8,18 @@
|
||||
var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/Initialize()
|
||||
. = ..()
|
||||
add_atom_colour("#404040", FIXED_COLOUR_PRIORITY)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/can_be_node(obj/machinery/atmospherics/pipe/heat_exchanging/target)
|
||||
if(!istype(target))
|
||||
return 0
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
return 1
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/isConnectable(obj/machinery/atmospherics/pipe/heat_exchanging/target, given_layer, HE_type_check = TRUE)
|
||||
if(istype(target, /obj/machinery/atmospherics/pipe/heat_exchanging) != HE_type_check)
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/hide()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/GetInitDirections()
|
||||
return ..() | initialize_directions_he
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos()
|
||||
var/environment_temperature = 0
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
@@ -56,8 +51,6 @@
|
||||
L.bodytemperature = avg_temp
|
||||
pipe_air.temperature = avg_temp
|
||||
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/process()
|
||||
if(!parent)
|
||||
return //machines subsystem fires before atmos is initialized so this prevents race condition runtimes
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = NORTH
|
||||
initialize_directions_he = SOUTH
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
|
||||
construction_type = /obj/item/pipe/directional
|
||||
pipe_state = "junction"
|
||||
|
||||
@@ -26,34 +24,18 @@
|
||||
piping_layer = PIPING_LAYER_MAX
|
||||
pixel_x = PIPING_LAYER_P_X
|
||||
pixel_y = PIPING_LAYER_P_Y
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/SetInitDirections()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH
|
||||
initialize_directions_he = SOUTH
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH
|
||||
initialize_directions_he = NORTH
|
||||
if(EAST)
|
||||
initialize_directions = WEST
|
||||
initialize_directions_he = EAST
|
||||
if(WEST)
|
||||
initialize_directions = EAST
|
||||
initialize_directions_he = WEST
|
||||
if(NORTH,SOUTH)
|
||||
initialize_directions = SOUTH|NORTH
|
||||
if(EAST,WEST)
|
||||
initialize_directions = WEST|EAST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/getNodeConnects()
|
||||
return list(turn(dir, 180), dir)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
var/init_dir
|
||||
switch(iteration)
|
||||
if(1)
|
||||
init_dir = target.initialize_directions
|
||||
if(2)
|
||||
var/obj/machinery/atmospherics/pipe/heat_exchanging/H = target
|
||||
if(!istype(H))
|
||||
return 0
|
||||
init_dir = H.initialize_directions_he
|
||||
if(init_dir & get_dir(target,src))
|
||||
return 1
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/isConnectable(obj/machinery/atmospherics/target, given_layer, he_type_check)
|
||||
if(dir == get_dir(target, src))
|
||||
return ..(target, given_layer, FALSE) //we want a normal pipe instead
|
||||
return ..(target, given_layer, TRUE)
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
desc = "A manifold composed of regular pipes."
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions_he = EAST|NORTH|WEST
|
||||
initialize_directions = EAST|NORTH|WEST
|
||||
|
||||
device_type = TRINARY
|
||||
|
||||
construction_type = /obj/item/pipe/trinary
|
||||
pipe_state = "he_manifold"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/layer1
|
||||
piping_layer = PIPING_LAYER_MIN
|
||||
pixel_x = -PIPING_LAYER_P_X
|
||||
@@ -26,13 +26,13 @@
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/SetInitDirections()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions_he = EAST|SOUTH|WEST
|
||||
initialize_directions = EAST|SOUTH|WEST
|
||||
if(SOUTH)
|
||||
initialize_directions_he = WEST|NORTH|EAST
|
||||
initialize_directions = WEST|NORTH|EAST
|
||||
if(EAST)
|
||||
initialize_directions_he = SOUTH|WEST|NORTH
|
||||
initialize_directions = SOUTH|WEST|NORTH
|
||||
if(WEST)
|
||||
initialize_directions_he = NORTH|EAST|SOUTH
|
||||
initialize_directions = NORTH|EAST|SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/update_icon()
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
@@ -53,13 +53,13 @@
|
||||
name = "4-way pipe manifold"
|
||||
desc = "A manifold composed of heat-exchanging pipes."
|
||||
|
||||
initialize_directions_he = NORTH|SOUTH|EAST|WEST
|
||||
initialize_directions = NORTH|SOUTH|EAST|WEST
|
||||
|
||||
device_type = QUATERNARY
|
||||
|
||||
construction_type = /obj/item/pipe/quaternary
|
||||
pipe_state = "he_manifold4w"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/layer1
|
||||
piping_layer = PIPING_LAYER_MIN
|
||||
pixel_x = -PIPING_LAYER_P_X
|
||||
@@ -71,7 +71,7 @@
|
||||
pixel_y = PIPING_LAYER_P_Y
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/SetInitDirections()
|
||||
initialize_directions_he = initial(initialize_directions_he)
|
||||
initialize_directions = initial(initialize_directions)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_icon()
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
desc = "A one meter section of heat-exchanging pipe."
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
construction_type = /obj/item/pipe/binary/bendable
|
||||
pipe_state = "he"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/layer1
|
||||
piping_layer = PIPING_LAYER_MIN
|
||||
pixel_x = -PIPING_LAYER_P_X
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections()
|
||||
if(dir in GLOB.diagonals)
|
||||
initialize_directions_he = dir
|
||||
initialize_directions = dir
|
||||
switch(dir)
|
||||
if(NORTH,SOUTH)
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
if(EAST,WEST)
|
||||
initialize_directions_he = WEST|EAST
|
||||
initialize_directions = WEST|EAST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/proc/normalize_dir()
|
||||
if(dir==SOUTH)
|
||||
|
||||
Reference in New Issue
Block a user