Fix pipe construction conflicting with existing pipes too much.

Bug in the init_dirs_cache was not setting direction of pipes, making all cached dirs be for south.
Because mapped in pipes didn't have piping layer set, mapped in pipes conflicted.
The full-tile check for unary machines forgot to exclude *itself*
This commit is contained in:
Leshana
2018-03-09 12:36:43 -05:00
parent 63a1dd0143
commit d8938a4e5b
9 changed files with 62 additions and 3 deletions

View File

@@ -455,3 +455,40 @@
var/sink_pressure = sink.return_pressure()
return (source_pressure - sink_pressure)/(R_IDEAL_GAS_EQUATION * (source.temperature/source_volume + sink.temperature/sink_volume))
//
// Debugging helper procs
//
/proc/atmos_piping_layer_str(piping_layer)
switch(piping_layer)
if(PIPING_LAYER_SUPPLY)
return "SUPPLY"
if(PIPING_LAYER_REGULAR)
return "REGULAR"
if(PIPING_LAYER_SCRUBBER)
return "SCRUBBER"
/proc/atmos_pipe_flags_str(pipe_flags)
var/list/dat = list()
if(pipe_flags & PIPING_ALL_LAYER)
dat += "ALL_LAYER"
if(pipe_flags & PIPING_ONE_PER_TURF)
dat += "ONE_PER_TURF"
if(pipe_flags & PIPING_DEFAULT_LAYER_ONLY)
dat += "DEFAULT_LAYER_ONLY"
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
dat += "CARDINAL_AUTONORMALIZE"
return dat.Join("|")
/proc/atmos_connect_types_str(connect_types)
var/list/dat = list()
if(connect_types & CONNECT_TYPE_REGULAR)
dat += "REGULAR"
if(connect_types & CONNECT_TYPE_SUPPLY)
dat += "SUPPLY"
if(connect_types & CONNECT_TYPE_SCRUBBER)
dat += "SCRUBBER"
if(connect_types & CONNECT_TYPE_HE)
dat += "HE"
return dat.Join("|")

View File

@@ -33,11 +33,12 @@ Pipelines + Other Objects -> Pipe network
var/obj/machinery/atmospherics/node1
var/obj/machinery/atmospherics/node2
/obj/machinery/atmospherics/New()
/obj/machinery/atmospherics/New(loc, newdir)
..()
if(!icon_manager)
icon_manager = new()
if(!isnull(newdir))
set_dir(newdir)
if(!pipe_color)
pipe_color = color
color = null

View File

@@ -104,6 +104,7 @@
// Returns TRUE if something is blocking, FALSE if its okay to continue.
/obj/machinery/atmospherics/unary/proc/check_for_obstacles()
for(var/obj/machinery/atmospherics/M in loc)
if(M == src) continue
if((M.pipe_flags & pipe_flags & PIPING_ONE_PER_TURF)) //Only one dense/requires density object per tile, eg connectors/cryo/heater/coolers.
visible_message("<span class='warning'>\The [src]'s cannot be connected, something is hogging the tile!</span>")
return TRUE

View File

@@ -79,6 +79,7 @@
desc = "An endcap for scrubbers pipes"
icon_state = "cap-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -88,6 +89,7 @@
desc = "An endcap for supply pipes"
icon_state = "cap-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
@@ -102,6 +104,7 @@
desc = "An endcap for scrubbers pipes"
icon_state = "cap-f-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -111,6 +114,7 @@
desc = "An endcap for supply pipes"
icon_state = "cap-f-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE

View File

@@ -165,6 +165,7 @@
desc = "A manifold composed of scrubbers pipes"
icon_state = "map-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -174,6 +175,7 @@
desc = "A manifold composed of supply pipes"
icon_state = "map-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
@@ -209,6 +211,7 @@
desc = "A manifold composed of scrubbers pipes"
icon_state = "map-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -218,6 +221,7 @@
desc = "A manifold composed of supply pipes"
icon_state = "map-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE

View File

@@ -167,6 +167,7 @@
desc = "A manifold composed of scrubbers pipes"
icon_state = "map_4way-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -176,6 +177,7 @@
desc = "A manifold composed of supply pipes"
icon_state = "map_4way-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
@@ -211,6 +213,7 @@
desc = "A manifold composed of scrubbers pipes"
icon_state = "map_4way-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -220,6 +223,7 @@
desc = "A manifold composed of supply pipes"
icon_state = "map_4way-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE

View File

@@ -172,6 +172,7 @@
desc = "A one meter section of scrubbers pipe"
icon_state = "intact-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -181,6 +182,7 @@
desc = "A one meter section of supply pipe"
icon_state = "intact-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
@@ -216,6 +218,7 @@
desc = "A one meter section of scrubbers pipe"
icon_state = "intact-scrubbers"
connect_types = CONNECT_TYPE_SCRUBBER
piping_layer = PIPING_LAYER_SCRUBBER
layer = 2.38
icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
@@ -225,6 +228,7 @@
desc = "A one meter section of supply pipe"
icon_state = "intact-supply"
connect_types = CONNECT_TYPE_SUPPLY
piping_layer = PIPING_LAYER_SUPPLY
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE