Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Several pipe cap visibility fixes #2430

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions code/modules/atmospherics/machinery/atmosmachinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,10 @@
if(!has_cap_visuals)
return

var/turf/our_turf = get_turf(src)
our_turf.vis_contents -= cap_overlay
cap_overlay?.moveToNullspace()

if(!HAS_TRAIT(src, TRAIT_UNDERFLOOR))
return

var/connections = NONE
for(var/obj/machinery/atmospherics/node in nodes)
Expand All @@ -660,8 +662,8 @@
if(connections == NONE)
return

var/bitfield = CARDINAL_TO_PIPECAPS(connections)
bitfield |= ((~connections) & ALL_CARDINALS)
var/bitfield = CARDINAL_TO_PIPECAPS(connections) | (~connections) & ALL_CARDINALS
var/turf/our_turf = get_turf(src)

if(isnull(cap_overlay))
cap_overlay = new
Expand All @@ -672,12 +674,13 @@
cap_overlay.layer = layer
cap_overlay.icon_state = "[bitfield]_[piping_layer]"

our_turf.vis_contents += cap_overlay
cap_overlay.forceMove(our_turf)

/obj/effect/overlay/cap_visual
appearance_flags = KEEP_APART
vis_flags = VIS_INHERIT_ID
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
icon = 'icons/obj/pipes_n_cables/!pipes_bitmask.dmi'
vis_flags = NONE
anchored = TRUE

/**
* Called by the RPD.dm pre_attack()
Expand Down
Loading