RPD now builds even when clicked on another pipe (#17831)

This commit is contained in:
Ling
2023-02-10 10:28:20 +01:00
committed by GitHub
parent 51fd6de808
commit d35292c3d4

View File

@@ -390,7 +390,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list(
//make sure what we're clicking is valid for the current category
var/static/list/make_pipe_whitelist
if(!make_pipe_whitelist)
make_pipe_whitelist = typecacheof(list(/obj/structure/lattice, /obj/structure/girder, /obj/item/pipe, /obj/structure/window, /obj/structure/grille))
make_pipe_whitelist = typecacheof(list(/obj/structure/lattice, /obj/structure/girder, /obj/item/pipe, /obj/structure/window, /obj/structure/grille, /obj/machinery/atmospherics/pipe))
var/can_make_pipe = (isturf(A) || is_type_in_typecache(A, make_pipe_whitelist))
. = FALSE
@@ -410,7 +410,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list(
qdel(A)
return
if((mode&PAINT_MODE))
if (mode & PAINT_MODE)
if(istype(A, /obj/machinery/atmospherics/pipe) && !istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
var/obj/machinery/atmospherics/pipe/P = A
to_chat(user, span_notice("You start painting \the [P] [paint_color]..."))
@@ -432,10 +432,12 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list(
if(istype(get_area(user), /area/reebe/city_of_cogs))
to_chat(user, span_notice("You cannot build on Reebe.."))
return
switch(category) //if we've gotten this var, the target is valid
if(ATMOS_CATEGORY) //Making pipes
if(!can_make_pipe)
return ..()
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
if (recipe.type == /datum/pipe_info/meter)
to_chat(user, span_notice("You start building a meter..."))