mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Ensures that one can only paint pipes within range and that there is no blocking floor tile.
This commit is contained in:
@@ -7,9 +7,15 @@
|
||||
var/mode = "grey"
|
||||
|
||||
/obj/item/device/pipe_painter/afterattack(atom/A, mob/user as mob)
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/pipe/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/pipe/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated) || !in_range(user, A))
|
||||
return
|
||||
var/obj/machinery/atmospherics/pipe/P = A
|
||||
|
||||
var/turf/T = P.loc
|
||||
if (T.level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return
|
||||
|
||||
P.pipe_color = mode
|
||||
user.visible_message("<span class='notice'>[user] paints \the [P] [mode].</span>","<span class='notice'>You paint \the [P] [mode].</span>")
|
||||
P.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user