From c9f2d282d61f18873b4fabb659eea5892bb3dfb3 Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Sun, 3 May 2015 17:34:18 +0100 Subject: [PATCH] Fixes #9311, Fixes destroyed pipes still being in pipe vision, Pipe vision now appears above darkness. --- code/ATMOSPHERICS/atmospherics.dm | 26 +++++++++---------------- code/modules/mob/living/ventcrawling.dm | 11 +++++++---- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index b596f63eaf8..7fcc9ac67d0 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -25,12 +25,7 @@ Pipelines + Other Objects -> Pipe network var/global/list/pipeimages = list() var/datum/pipeline/parent = null - -/obj/machinery/atmospherics/Destroy() - for(var/mob/living/L in src) - L.remove_ventcrawl() - L.forceMove(get_turf(src)) - ..() + var/image/pipe_vision_img = null /obj/machinery/atmospherics/New() @@ -45,6 +40,13 @@ Pipelines + Other Objects -> Pipe network if (stored) qdel(stored) stored = null + + for(var/mob/living/L in src) + L.remove_ventcrawl() + L.forceMove(get_turf(src)) + if(pipe_vision_img) + qdel(pipe_vision_img) + ..() //this is called just after the air controller sets up turfs @@ -128,6 +130,7 @@ Pipelines + Other Objects -> Pipe network var/turf/T = loc stored.loc = T transfer_fingerprints_to(stored) + stored = null qdel(src) @@ -200,17 +203,6 @@ Pipelines + Other Objects -> Pipe network else if(target_move.can_crawl_through()) if(returnPipenet() != target_move.returnPipenet()) user.update_pipe_vision(target_move) - - /* - var/list/myPipenets = getAllPipenets() - var/list/targetAllPipenets = target_move.getAllPipenets() - for(var/datum/pipeline/I in targetAllPipenets) - for(var/datum/pipeline/J in myPipenets) - if(I != J) - update_pipe_vision(target_move) - break - */ - user.loc = target_move user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement if(world.time - user.last_played_vent > VENT_SOUND_DELAY) diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index d4425c434ba..9165e233d1b 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -68,11 +68,14 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, var/list/totalMembers = list() totalMembers |= starting_machine.parent.members totalMembers |= starting_machine.parent.other_atmosmch - for(var/atom/A in totalMembers) - var/image/new_image = image(A, A.loc, dir = A.dir) - pipes_shown += new_image + + for(var/obj/machinery/atmospherics/A in totalMembers) + if(!A.pipe_vision_img) + A.pipe_vision_img = image(A, A.loc, layer = 20, dir = A.dir) + //20 for being above darkness + pipes_shown |= A.pipe_vision_img if(client) - client.images += new_image + client.images |= A.pipe_vision_img /mob/living/proc/remove_ventcrawl()