From 59f654f8b9df2415d698e1caa71d1f8016c823ca Mon Sep 17 00:00:00 2001 From: deathride58 Date: Fri, 10 Nov 2017 23:55:08 +0000 Subject: [PATCH] [s] Fixes RPDs qdel'ing girders and causing runtimes (#32567) * fixes qdeling girders and lattices with RPDs and other weird edge cases * thanks mom the shitcode's cleaner now * :+1: --- code/game/objects/items/RPD.dm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm index 9b9f7e6000..3995cec926 100644 --- a/code/game/objects/items/RPD.dm +++ b/code/game/objects/items/RPD.dm @@ -546,13 +546,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( A = get_turf(user) //make sure what we're clicking is valid for the current mode - var/is_paintable = (p_class == PAINT_MODE && istype(A, /obj/machinery/atmospherics/pipe)) - var/is_consumable = (p_class == EATING_MODE && (istype(A, /obj/item/pipe) || istype(A, /obj/item/pipe_meter) || istype(A, /obj/structure/disposalconstruct))) var/can_make_pipe = ((atmos_piping_mode || p_class == DISPOSALS_MODE) && (isturf(A)) || istype(A, /obj/structure/lattice) || istype(A, /obj/structure/girder)) - if(!is_paintable && !is_consumable && !can_make_pipe) - return ..() - //So that changing the menu settings doesn't affect the pipes already being built. var/queued_p_type = p_type var/queued_p_dir = p_dir @@ -561,6 +556,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( . = FALSE switch(p_class) //if we've gotten this var, the target is valid if(PAINT_MODE) //Paint pipes + if(!istype(A, /obj/machinery/atmospherics/pipe)) + return ..() var/obj/machinery/atmospherics/pipe/P = A playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) P.paint(paint_colors[paint_color]) @@ -568,6 +565,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( return if(EATING_MODE) //Eating pipes + if(!(istype(A, /obj/item/pipe) || istype(A, /obj/item/pipe_meter) || istype(A, /obj/structure/disposalconstruct))) + return ..() to_chat(user, "You start destroying a pipe...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) if(do_after(user, 2, target = A)) @@ -575,6 +574,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( qdel(A) if(ATMOS_MODE) //Making pipes + if(!can_make_pipe) + return ..() to_chat(user, "You start building a pipe...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) if(do_after(user, 2, target = A)) @@ -599,6 +600,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( P.setPipingLayer(piping_layer) if(METER_MODE) //Making pipe meters + if(!can_make_pipe) + return ..() to_chat(user, "You start building a meter...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) if(do_after(user, 2, target = A)) @@ -610,6 +613,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list( PM.setAttachLayer(piping_layer) if(DISPOSALS_MODE) //Making disposals pipes + if(!can_make_pipe) + return ..() if(isclosedturf(A)) to_chat(user, "\the [src]'s error light flickers; there's something in the way!") return