From 1fa4e7111dd29fe0f80e632110337ba737d01670 Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Thu, 11 Nov 2010 01:41:38 +0000 Subject: [PATCH] Fixed a runtime error when you try building a pipe section that doesn't connect to something git-svn-id: http://tgstation13.googlecode.com/svn/trunk@399 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/pipe/construction.dm | 35 ++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 614fe3396f6..4606b5936c4 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -190,13 +190,16 @@ Buildable meters P.initialize_directions = EAST|WEST P.level = level P.initialize() - P.build_network() - if (P.node1) - P.node1.initialize() - P.node1.build_network() - if (P.node2) - P.node2:initialize() - P.node2.build_network() + if (P) + P.build_network() + if (P.node1) + P.node1.initialize() + P.node1.build_network() + if (P.node2) + P.node2:initialize() + P.node2.build_network() + else + usr << "There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)" if(1) // bent pipe @@ -216,13 +219,17 @@ Buildable meters P.initialize_directions = NORTH|WEST P.level = level P.initialize() - P.build_network() - if (P.node1) - P.node1.initialize() - P.node1.build_network() - if (P.node2) - P.node2:initialize() - P.node2.build_network() + if (P) + P.build_network() + if (P.node1) + P.node1.initialize() + P.node1.build_network() + if (P.node2) + P.node2:initialize() + P.node2.build_network() + else + usr << "There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)" + /* if(2,3) // straight or bent h/e pipe