Skip to content

Commit

Permalink
Pipe direction fix. (#1)
Browse files Browse the repository at this point in the history
* Test

* Test

* Forgot to do this thing.

* Okay

* Why did I do that?

* Arghh

* Not sure how that got here.
  • Loading branch information
Pickle-Coding committed Aug 10, 2021
1 parent 6671847 commit 7ffd5b5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/modules/atmospherics/machinery/pipes/smart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ GLOBAL_LIST_INIT(atmos_components, typecacheof(list(/obj/machinery/atmospherics)
construction_type = /obj/item/pipe/quaternary
pipe_state = "manifold4w"
connection_num = 0
var/list/connections

/obj/machinery/atmospherics/pipe/smart/update_pipe_icon()
icon = 'icons/obj/atmospherics/pipes/pipes_bitmask.dmi'
var/bitfield = NONE
var/bits = 0
connections = 0
connection_num = NONE
for(var/i in 1 to device_type)
if(!nodes[i])
continue
var/obj/machinery/atmospherics/node = nodes[i]
var/connected_dir = get_dir(src, node)
connections |= connected_dir
connection_num += 1
bits++
switch(connected_dir)
if(NORTH)
Expand Down Expand Up @@ -56,6 +61,17 @@ GLOBAL_LIST_INIT(atmos_components, typecacheof(list(/obj/machinery/atmospherics)
bitfield |= WEST_SHORTPIPE

icon_state = "[bitfield]_[piping_layer]"
switch(connection_num)
if(0)
dir = 2
if(1)
dir = connections
if(2)
dir = check_binary_direction(connections)
if(3)
dir = connections
if(4)
dir = 15

/obj/machinery/atmospherics/pipe/smart/SetInitDirections(init_dir)
if(init_dir)
Expand Down

0 comments on commit 7ffd5b5

Please sign in to comment.