From 757b76c456a029974eddb3e25f490eb376a676fd Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Tue, 24 Apr 2012 21:04:05 +0100 Subject: [PATCH] TG: A couple sanity checks i forgot to include in disposals These might prove to be pointless but i'd rather be overly cautious about something that crashes a server in 3 seconds flat Revision: r3191 Author: quartz235 --- code/modules/recycling/disposal.dm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 6fdce6d5bce..59f6d61140e 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -744,7 +744,8 @@ return // otherwise, do normal expel from turf - expel(H, T, 0) + if(H) + expel(H, T, 0) ..() // returns the direction of the next pipe object, given the entrance dir @@ -920,7 +921,8 @@ return // otherwise, do normal expel from turf - expel(H, T, 0) + if(H) + expel(H, T, 0) spawn(2) // delete pipe after 2 ticks to ensure expel proc finished del(src) @@ -1265,13 +1267,15 @@ // otherwise, go to the linked object if(linked) var/obj/structure/disposaloutlet/O = linked - if(istype(O)) + if(istype(O) && (H)) O.expel(H) // expel at outlet else var/obj/machinery/disposal/D = linked - D.expel(H) // expel at disposal + if(H) + D.expel(H) // expel at disposal else - src.expel(H, src.loc, 0) // expel at turf + if(H) + src.expel(H, src.loc, 0) // expel at turf return null // nextdir