diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm
index b4ffa7fd9cd..7f0b5671fdf 100644
--- a/code/game/objects/items/weapons/RPD.dm
+++ b/code/game/objects/items/weapons/RPD.dm
@@ -518,28 +518,22 @@ var/global/list/RPD_recipes=list(
show_menu(usr)
-/obj/item/weapon/pipe_dispenser/afterattack(atom/A, mob/user)
- if(!in_range(A,user) || loc != user)
- return 0
-
- if(!user.IsAdvancedToolUser())
- user << "You don't have the dexterity to do this!"
- return 0
-
- if(istype(A,/area/shuttle)||istype(A,/turf/open/space/transit))
- return 0
+/obj/item/weapon/pipe_dispenser/pre_attackby(atom/A, mob/user)
+ if(!user.IsAdvancedToolUser() || istype(A,/turf/open/space/transit))
+ 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
var/queued_p_flipped = p_flipped
+ . = FALSE
switch(p_class)
if(PAINT_MODE) // Paint pipes
if(!istype(A,/obj/machinery/atmospherics/pipe))
// Avoid spewing errors about invalid mode -2 when clicking on stuff that aren't pipes.
user << "\The [src]'s error light flickers! Perhaps you need to only use it on pipes and pipe meters?"
- return 0
+ return
var/obj/machinery/atmospherics/pipe/P = A
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
P.add_atom_colour(paint_colors[paint_color], FIXED_COLOUR_PRIORITY)
@@ -547,25 +541,23 @@ var/global/list/RPD_recipes=list(
user.visible_message("[user] paints \the [P] [paint_color].","You paint \the [P] [paint_color].")
//P.update_icon()
P.update_node_icon()
- return 1
+ return
if(EATING_MODE) // Eating pipes
// Must click on an actual pipe or meter.
- if(istype(A,/obj/item/pipe) || istype(A,/obj/item/pipe_meter) || istype(A,/obj/structure/disposalconstruct))
- user << "You start destroying pipe..."
- playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
- if(do_after(user, 2, target = A))
- activate()
- qdel(A)
- return 1
- return 0
+ if(!(istype(A,/obj/item/pipe) || istype(A,/obj/item/pipe_meter) || istype(A,/obj/structure/disposalconstruct)))
+ // Avoid spewing errors about invalid mode -1 when clicking on stuff that aren't pipes.
+ user << "The [src]'s error light flickers! Perhaps you need to only use it on pipes and pipe meters?"
+ return
+ user << "You start destroying pipe..."
+ playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
+ if(do_after(user, 2, target = A))
+ activate()
+ qdel(A)
- // Avoid spewing errors about invalid mode -1 when clicking on stuff that aren't pipes.
- user << "The [src]'s error light flickers! Perhaps you need to only use it on pipes and pipe meters?"
- return 0
if(ATMOS_MODE)
if(!isturf(A))
user << "The [src]'s error light flickers!"
- return 0
+ return
user << "You start building pipes..."
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 2, target = A))
@@ -574,8 +566,6 @@ var/global/list/RPD_recipes=list(
P.flipped = queued_p_flipped
P.update()
P.add_fingerprint(usr)
- return 1
- return 0
if(METER_MODE)
if(!isturf(A))
@@ -586,13 +576,11 @@ var/global/list/RPD_recipes=list(
if(do_after(user, 2, target = A))
activate()
new /obj/item/pipe_meter(A)
- return 1
- return 0
if(DISPOSALS_MODE)
if(!isturf(A) || is_anchored_dense_turf(A))
user << "The [src]'s error light flickers!"
- return 0
+ return
user << "You start building pipes..."
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 20, target = A))
@@ -601,17 +589,16 @@ var/global/list/RPD_recipes=list(
if(!C.can_place())
user << "There's not enough room to build that here!"
qdel(C)
- return 0
+ return
activate()
C.add_fingerprint(usr)
C.update_icon()
- return 1
- return 0
+ return
+
else
- ..()
- return 0
+ return ..()
/obj/item/weapon/pipe_dispenser/proc/activate()