Fixes pipe painter/RPD ignoring can_be_coloured (#25192)

* Fixes atmos pipe painter/RPD ignoring can_ne_coloured

* if
This commit is contained in:
jknpj
2019-11-30 16:02:07 -03:00
committed by adrian
parent e5c1dc941e
commit 70f9e94446
3 changed files with 13 additions and 8 deletions

View File

@@ -27,10 +27,8 @@
var/datum/pipeline/pipeline = parent
var/list/update_later = list()
for(var/obj/machinery/atmospherics/pipe in pipeline.members)
pipe.color = mass_colour
if(!pipe.can_be_coloured)
pipe.default_colour = mass_colour
update_later += pipe
if(pipe.can_be_coloured)
pipe.color = mass_colour
for(var/obj/machinery/atmospherics/pipe in pipeline.edges)
pipe.update_icon()
update_later -= pipeline.edges

View File

@@ -18,9 +18,12 @@
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/unary/tank) || istype(A,/obj/machinery/atmospherics/unary/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
return
var/obj/machinery/atmospherics/pipe/P = A
P.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()
if(P.can_be_coloured)
P.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()
return
to_chat(user, "<span class='danger'>\The [P] cannot be painted.</span>")
/obj/item/device/pipe_painter/attack_self(mob/user as mob)
mode = input("Which colour do you want to use?","Pipe painter") in modes

View File

@@ -109,6 +109,10 @@
var/obj/machinery/atmospherics/O = A
if(!O.can_be_coloured)
to_chat(user, "<span class='danger'>\The [O] cannot be painted.</span>")
return 1
playsound(master, 'sound/machines/click.ogg', 50, 1)
if (selected_color in available_colors)
selected_color = available_colors[selected_color]
@@ -118,7 +122,7 @@
var/obj/machinery/atmospherics/pipe/pipe_to_colour = O
var/datum/pipeline/pipe_line = pipe_to_colour.parent
var/list/pipeline_members = pipe_line.members
if (pipeline_members.len < 500)
if(pipeline_members.len < 500)
last_colouration = world.timeofday
colouring_delay = (pipeline_members.len)/2
O.color = selected_color