From c3a983739fd632be57b77d859633fcd84448a6ac Mon Sep 17 00:00:00 2001 From: Krausus Date: Mon, 15 Jun 2015 09:19:17 -0400 Subject: [PATCH] Fixes several potential pipe runtimes Pipes would naively assume they had a turf, even when they didn't (probably after getting qdel'd); they'll now abort turf-sensitive operations if turfless. This should cut down on pipe-deletion-related runtimes. --- code/ATMOSPHERICS/pipes.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 894798e25c9..f2f1b4b904c 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -470,7 +470,8 @@ update_icon() /obj/machinery/atmospherics/proc/universal_underlays(var/obj/machinery/atmospherics/node, var/direction) - var/turf/T = loc + var/turf/T = get_turf(src) + if(!istype(T)) return if(node) var/node_dir = get_dir(src,node) if(node.icon_connect_type == "-supply") @@ -632,6 +633,7 @@ underlays.Cut() var/turf/T = get_turf(src) + if(!istype(T)) return var/list/directions = list(NORTH, SOUTH, EAST, WEST) var/node1_direction = get_dir(src, node1) var/node2_direction = get_dir(src, node2) @@ -890,6 +892,7 @@ */ var/turf/T = get_turf(src) + if(!istype(T)) return var/list/directions = list(NORTH, SOUTH, EAST, WEST) var/node1_direction = get_dir(src, node1) var/node2_direction = get_dir(src, node2) @@ -1104,7 +1107,8 @@ node = target break - var/turf/T = src.loc // hide if turf is not intact + var/turf/T = get_turf(src) // hide if turf is not intact + if(!istype(T)) return hide(T.intact) update_icon()